Class ImaServerSideAdInsertionMediaSource.AdsLoader.Builder
- java.lang.Object
-
- com.google.android.exoplayer2.ext.ima.ImaServerSideAdInsertionMediaSource.AdsLoader.Builder
-
- Enclosing class:
- ImaServerSideAdInsertionMediaSource.AdsLoader
public static final class ImaServerSideAdInsertionMediaSource.AdsLoader.Builder extends Object
Builder for building anImaServerSideAdInsertionMediaSource.AdsLoader.
-
-
Constructor Summary
Constructors Constructor Description Builder(Context context, AdViewProvider adViewProvider)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImaServerSideAdInsertionMediaSource.AdsLoaderbuild()Returns a newImaServerSideAdInsertionMediaSource.AdsLoader.ImaServerSideAdInsertionMediaSource.AdsLoader.BuildersetAdErrorListener(com.google.ads.interactivemedia.v3.api.AdErrorEvent.AdErrorListener adErrorListener)Sets the optionalAdErrorEvent.AdErrorListenerthat will be passed toBaseManager.addAdErrorListener(AdErrorEvent.AdErrorListener).ImaServerSideAdInsertionMediaSource.AdsLoader.BuildersetAdEventListener(com.google.ads.interactivemedia.v3.api.AdEvent.AdEventListener adEventListener)Sets the optionalAdEvent.AdEventListenerthat will be passed toBaseManager.addAdEventListener(AdEventListener).ImaServerSideAdInsertionMediaSource.AdsLoader.BuildersetAdsLoaderState(ImaServerSideAdInsertionMediaSource.AdsLoader.State state)Sets the optional state to resume with.ImaServerSideAdInsertionMediaSource.AdsLoader.BuildersetCompanionAdSlots(Collection<com.google.ads.interactivemedia.v3.api.CompanionAdSlot> companionAdSlots)Sets the slots to use for companion ads, if they are present in the loaded ad.ImaServerSideAdInsertionMediaSource.AdsLoader.BuildersetFocusSkipButtonWhenAvailable(boolean focusSkipButtonWhenAvailable)Sets whether to focus the skip button (when available) on Android TV devices.ImaServerSideAdInsertionMediaSource.AdsLoader.BuildersetImaSdkSettings(com.google.ads.interactivemedia.v3.api.ImaSdkSettings imaSdkSettings)Sets the IMA SDK settings.
-
-
-
Constructor Detail
-
Builder
public Builder(Context context, AdViewProvider adViewProvider)
Creates an instance.- Parameters:
context- A context.adViewProvider- A provider forViewGroupinstances.
-
-
Method Detail
-
setImaSdkSettings
@CanIgnoreReturnValue public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setImaSdkSettings(com.google.ads.interactivemedia.v3.api.ImaSdkSettings imaSdkSettings)
Sets the IMA SDK settings.If this method is not called, the default settings will be used with the language set to the preferred system language.
- Parameters:
imaSdkSettings- TheImaSdkSettings.- Returns:
- This builder, for convenience.
-
setAdEventListener
@CanIgnoreReturnValue public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setAdEventListener(com.google.ads.interactivemedia.v3.api.AdEvent.AdEventListener adEventListener)
Sets the optionalAdEvent.AdEventListenerthat will be passed toBaseManager.addAdEventListener(AdEventListener).- Parameters:
adEventListener- The ad event listener.- Returns:
- This builder, for convenience.
-
setAdErrorListener
@CanIgnoreReturnValue public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setAdErrorListener(com.google.ads.interactivemedia.v3.api.AdErrorEvent.AdErrorListener adErrorListener)
Sets the optionalAdErrorEvent.AdErrorListenerthat will be passed toBaseManager.addAdErrorListener(AdErrorEvent.AdErrorListener).- Parameters:
adErrorListener- TheAdErrorEvent.AdErrorListener.- Returns:
- This builder, for convenience.
-
setCompanionAdSlots
@CanIgnoreReturnValue public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setCompanionAdSlots(Collection<com.google.ads.interactivemedia.v3.api.CompanionAdSlot> companionAdSlots)
Sets the slots to use for companion ads, if they are present in the loaded ad.- Parameters:
companionAdSlots- The slots to use for companion ads.- Returns:
- This builder, for convenience.
- See Also:
BaseDisplayContainer.setCompanionSlots(Collection)
-
setAdsLoaderState
@CanIgnoreReturnValue public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setAdsLoaderState(ImaServerSideAdInsertionMediaSource.AdsLoader.State state)
Sets the optional state to resume with.The state can be received when
releasingtheImaServerSideAdInsertionMediaSource.AdsLoader.- Parameters:
state- The state to resume with.- Returns:
- This builder, for convenience.
-
setFocusSkipButtonWhenAvailable
@CanIgnoreReturnValue public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setFocusSkipButtonWhenAvailable(boolean focusSkipButtonWhenAvailable)
Sets whether to focus the skip button (when available) on Android TV devices. The default setting istrue.- Parameters:
focusSkipButtonWhenAvailable- Whether to focus the skip button (when available) on Android TV devices.- Returns:
- This builder, for convenience.
- See Also:
AdsRenderingSettings.setFocusSkipButtonWhenAvailable(boolean)
-
build
public ImaServerSideAdInsertionMediaSource.AdsLoader build()
Returns a newImaServerSideAdInsertionMediaSource.AdsLoader.
-
-