public final class

ImaServerSideAdInsertionMediaSource.AdsLoader.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource.AdsLoader.Builder

Overview

Builder for building an ImaServerSideAdInsertionMediaSource.AdsLoader.

Summary

Constructors
publicBuilder(Context context, AdViewProvider adViewProvider)

Creates an instance.

Methods
public ImaServerSideAdInsertionMediaSource.AdsLoaderbuild()

Returns a new ImaServerSideAdInsertionMediaSource.AdsLoader.

public ImaServerSideAdInsertionMediaSource.AdsLoader.BuildersetAdErrorListener(AdErrorEvent.AdErrorListener adErrorListener)

Sets the optional that will be passed to .

public ImaServerSideAdInsertionMediaSource.AdsLoader.BuildersetAdEventListener(AdEventListener adEventListener)

Sets the optional that will be passed to .

public ImaServerSideAdInsertionMediaSource.AdsLoader.BuildersetAdsLoaderState(ImaServerSideAdInsertionMediaSource.AdsLoader.State state)

Sets the optional state to resume with.

public ImaServerSideAdInsertionMediaSource.AdsLoader.BuildersetCompanionAdSlots(java.util.Collection<CompanionAdSlot> companionAdSlots)

Sets the slots to use for companion ads, if they are present in the loaded ad.

public ImaServerSideAdInsertionMediaSource.AdsLoader.BuildersetImaSdkSettings(ImaSdkSettings imaSdkSettings)

Sets the IMA SDK settings.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(Context context, AdViewProvider adViewProvider)

Creates an instance.

Parameters:

context: A context.
adViewProvider: A provider for ViewGroup instances.

Methods

public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setImaSdkSettings(ImaSdkSettings imaSdkSettings)

Sets the IMA SDK settings.

If this method is not called the default settings will be used.

Parameters:

imaSdkSettings: The .

Returns:

This builder, for convenience.

public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setAdEventListener(AdEventListener adEventListener)

Sets the optional that will be passed to .

Parameters:

adEventListener: The ad event listener.

Returns:

This builder, for convenience.

public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setAdErrorListener(AdErrorEvent.AdErrorListener adErrorListener)

Sets the optional that will be passed to .

Parameters:

adErrorListener: The .

Returns:

This builder, for convenience.

public ImaServerSideAdInsertionMediaSource.AdsLoader.Builder setCompanionAdSlots(java.util.Collection<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:

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.

Returns a new ImaServerSideAdInsertionMediaSource.AdsLoader.