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.

Nested Class Summary

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

Public Method Summary

abstract void
addAdErrorListener(AdErrorEvent.AdErrorListener errorListener)
Registers a listener for errors that occur during the ads request.
abstract void
addAdsLoadedListener(AdsLoader.AdsLoadedListener loadedListener)
Registers a listener for the ads manager loaded event.
abstract void
contentComplete()
This method is deprecated. - Use VideoAdPlayerCallback.onContentComplete() or VideoStreamPlayerCallback.onContentComplete() instead. Do not trigger multiple times.
abstract ImaSdkSettings
getSettings()
Returns the IMA SDK settings instance.
abstract void
release()
Frees resources from the BaseDisplayContainer as well as the underlying WebView.
abstract void
removeAdErrorListener(AdErrorEvent.AdErrorListener errorListener)
Removes a listener for error events.
abstract void
removeAdsLoadedListener(AdsLoader.AdsLoadedListener loadedListener)
Removes a listener for the ads manager loaded event.
abstract void
requestAds(AdsRequest adsRequest)
Requests ads from a server.
abstract String
requestStream(StreamRequest streamRequest)
Initiates a stream session with server-side ad insertion.

Public Methods

public abstract void addAdErrorListener (AdErrorEvent.AdErrorListener errorListener)

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

Parameters
errorListener

public abstract void addAdsLoadedListener (AdsLoader.AdsLoadedListener loadedListener)

Registers a listener for the ads manager loaded event.

Parameters
loadedListener

public abstract void contentComplete ()

This method is deprecated.
- Use VideoAdPlayerCallback.onContentComplete() or VideoStreamPlayerCallback.onContentComplete() instead. Do not trigger multiple times.

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

public 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.

public abstract void release ()

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

public abstract void removeAdErrorListener (AdErrorEvent.AdErrorListener errorListener)

Removes a listener for error events.

Parameters
errorListener

public abstract void removeAdsLoadedListener (AdsLoader.AdsLoadedListener loadedListener)

Removes a listener for the ads manager loaded event.

Parameters
loadedListener

public abstract void requestAds (AdsRequest adsRequest)

Requests ads from a server.

Parameters
adsRequest An object containing ads request parameters. This object cannot be null, and it must contain a non-null AdDisplayContainer and ad tag URL.

public abstract String requestStream (StreamRequest streamRequest)

Initiates a stream session with server-side ad insertion.

Parameters
streamRequest An object containing stream request parameters. This object cannot be null, and it must contain a non-null AdDisplayContainer and asset key.
Returns
  • the SDK-generated session ID for the current ads session, as initiated by a stream request.