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.AdsLoader
build()
Returns a newImaServerSideAdInsertionMediaSource.AdsLoader
.ImaServerSideAdInsertionMediaSource.AdsLoader.Builder
setAdErrorListener(com.google.ads.interactivemedia.v3.api.AdErrorEvent.AdErrorListener adErrorListener)
Sets the optionalAdErrorEvent.AdErrorListener
that will be passed toBaseManager.addAdErrorListener(AdErrorEvent.AdErrorListener)
.ImaServerSideAdInsertionMediaSource.AdsLoader.Builder
setAdEventListener(com.google.ads.interactivemedia.v3.api.AdEvent.AdEventListener adEventListener)
Sets the optionalAdEvent.AdEventListener
that will be passed toBaseManager.addAdEventListener(AdEventListener)
.ImaServerSideAdInsertionMediaSource.AdsLoader.Builder
setAdsLoaderState(ImaServerSideAdInsertionMediaSource.AdsLoader.State state)
Sets the optional state to resume with.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.ImaServerSideAdInsertionMediaSource.AdsLoader.Builder
setFocusSkipButtonWhenAvailable(boolean focusSkipButtonWhenAvailable)
Sets whether to focus the skip button (when available) on Android TV devices.ImaServerSideAdInsertionMediaSource.AdsLoader.Builder
setImaSdkSettings(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 forViewGroup
instances.
-
-
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.AdEventListener
that 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.AdErrorListener
that 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
releasing
theImaServerSideAdInsertionMediaSource.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
.
-
-