Back to Exoplayer

ImaServerSideAdInsertionMediaSource.AdsLoader.Builder (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/ext/ima/ImaServerSideAdInsertionMediaSource.AdsLoader.Builder.html

latest7.8 KB
Original Source

Package com.google.android.exoplayer2.ext.ima

Class ImaServerSideAdInsertionMediaSource.AdsLoader.Builder


public static final classImaServerSideAdInsertionMediaSource.AdsLoader.Builderextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Builder for building an ImaServerSideAdInsertionMediaSource.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 new ImaServerSideAdInsertionMediaSource.AdsLoader. | | ImaServerSideAdInsertionMediaSource.AdsLoader.Builder | setAdErrorListener​(com.google.ads.interactivemedia.v3.api.AdErrorEvent.AdErrorListener adErrorListener) | Sets the optional AdErrorEvent.AdErrorListener that will be passed to BaseManager.addAdErrorListener(AdErrorEvent.AdErrorListener). | | ImaServerSideAdInsertionMediaSource.AdsLoader.Builder | setAdEventListener​(com.google.ads.interactivemedia.v3.api.AdEvent.AdEventListener adEventListener) | Sets the optional AdEvent.AdEventListener that will be passed to BaseManager.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. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

Builder

public Builder​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,[AdViewProvider](../../ui/AdViewProvider.html "interface in com.google.android.exoplayer2.ui")adViewProvider)

Creates an instance. Parameters:context - A context.adViewProvider - A provider for ViewGroup instances.

Method Detail

- 

setImaSdkSettings

@CanIgnoreReturnValue
public[ImaServerSideAdInsertionMediaSource.AdsLoader.Builder](ImaServerSideAdInsertionMediaSource.AdsLoader.Builder.html "class in com.google.android.exoplayer2.ext.ima")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 - The ImaSdkSettings.Returns:This builder, for convenience.

- 

setAdEventListener

@CanIgnoreReturnValue
public[ImaServerSideAdInsertionMediaSource.AdsLoader.Builder](ImaServerSideAdInsertionMediaSource.AdsLoader.Builder.html "class in com.google.android.exoplayer2.ext.ima")setAdEventListener​(com.google.ads.interactivemedia.v3.api.AdEvent.AdEventListener adEventListener)

Sets the optional AdEvent.AdEventListener that will be passed to BaseManager.addAdEventListener(AdEventListener). Parameters:adEventListener - The ad event listener.Returns:This builder, for convenience.

- 

setAdErrorListener

@CanIgnoreReturnValue
public[ImaServerSideAdInsertionMediaSource.AdsLoader.Builder](ImaServerSideAdInsertionMediaSource.AdsLoader.Builder.html "class in com.google.android.exoplayer2.ext.ima")setAdErrorListener​(com.google.ads.interactivemedia.v3.api.AdErrorEvent.AdErrorListener adErrorListener)

Sets the optional AdErrorEvent.AdErrorListener that will be passed to BaseManager.addAdErrorListener(AdErrorEvent.AdErrorListener). Parameters:adErrorListener - The AdErrorEvent.AdErrorListener.Returns:This builder, for convenience.

- 

setCompanionAdSlots

@CanIgnoreReturnValue
public[ImaServerSideAdInsertionMediaSource.AdsLoader.Builder](ImaServerSideAdInsertionMediaSource.AdsLoader.Builder.html "class in com.google.android.exoplayer2.ext.ima")setCompanionAdSlots​([Collection](https://developer.android.com/reference/java/util/Collection.html "class or interface in java.util")<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](ImaServerSideAdInsertionMediaSource.AdsLoader.Builder.html "class in com.google.android.exoplayer2.ext.ima")setAdsLoaderState​([ImaServerSideAdInsertionMediaSource.AdsLoader.State](ImaServerSideAdInsertionMediaSource.AdsLoader.State.html "class in com.google.android.exoplayer2.ext.ima")state)

Sets the optional state to resume with.

The state can be received when releasing the ImaServerSideAdInsertionMediaSource.AdsLoader.

Parameters:state - The state to resume with.Returns:This builder, for convenience.

- 

setFocusSkipButtonWhenAvailable

@CanIgnoreReturnValue
public[ImaServerSideAdInsertionMediaSource.AdsLoader.Builder](ImaServerSideAdInsertionMediaSource.AdsLoader.Builder.html "class in com.google.android.exoplayer2.ext.ima")setFocusSkipButtonWhenAvailable​(boolean focusSkipButtonWhenAvailable)

Sets whether to focus the skip button (when available) on Android TV devices. The default setting is true. 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](ImaServerSideAdInsertionMediaSource.AdsLoader.html "class in com.google.android.exoplayer2.ext.ima")build()

Returns a new ImaServerSideAdInsertionMediaSource.AdsLoader.