AdsLoader

public interface AdsLoader


An object which allows publishers to request ads from ad servers or a dynamic ad insertion stream. To do so, users must register for the AdsManagerLoadedEvent event and store a reference to the returned AdsManager or StreamManager.

Summary

Nested types

Listener interface for notification of ad load or stream load completion.

Public methods

abstract void

Registers a listener for errors that occur during the ads request.

abstract void

Registers a listener for the ads manager loaded event.

abstract void

This method is deprecated.

- Use VideoAdPlayerCallback.onContentComplete() or VideoStreamPlayerCallback.onContentComplete() instead.

abstract ImaSdkSettings

Returns the IMA SDK settings instance.

abstract void

Frees resources from the BaseDisplayContainer as well as the underlying WebView.

abstract void

Removes a listener for error events.

abstract void

Removes a listener for the ads manager loaded event.

abstract void
requestAds(AdsRequest adsRequest)

Requests ads from a server.

abstract String

Initiates a stream session with server-side ad insertion.

Public methods

addAdErrorListener

abstract void addAdErrorListener(AdErrorEvent.AdErrorListener errorListener)

Registers a listener for errors that occur during the ads request.

addAdsLoadedListener

abstract void addAdsLoadedListener(AdsLoader.AdsLoadedListener loadedListener)

Registers a listener for the ads manager loaded event.

contentComplete

abstract void contentComplete()

Signals to the SDK that the content is finished. This will allow the SDK to play post-roll ads, if any are loaded through ad rules.

getSettings

abstract ImaSdkSettings getSettings()

Returns the IMA SDK settings instance. To change the settings, just call the methods on the instance. The changes will apply for all ad requests made with this ads loader.

release

abstract void release()

Frees resources from the BaseDisplayContainer as well as the underlying WebView. This should occur after disposing of the BaseManager using destroy and after the manager has finished its own cleanup, as indicated by ALL_ADS_COMPLETED

removeAdErrorListener

abstract void removeAdErrorListener(AdErrorEvent.AdErrorListener errorListener)

Removes a listener for error events.

removeAdsLoadedListener

abstract void removeAdsLoadedListener(AdsLoader.AdsLoadedListener loadedListener)

Removes a listener for the ads manager loaded event.

requestAds

abstract void requestAds(AdsRequest adsRequest)

Requests ads from a server.

Parameters
AdsRequest adsRequest

An object containing ads request parameters. This object cannot be null. It must contain a non-null AdDisplayContainer and either an ad tag URL or an an ads response.

requestStream

abstract String requestStream(StreamRequest streamRequest)

Initiates a stream session with server-side ad insertion.

Parameters
StreamRequest streamRequest

An object containing stream request parameters. This object cannot be null, and it must contain a non-null AdDisplayContainer and asset key.

Returns
String

the SDK-generated session ID for the current ads session, as initiated by a stream request.