BaseManager

interface BaseManager : AdProgressProvider

Known direct subclasses
AdsManager

An object which handles playing ads after they've been received from the server.

StreamManager

An object which manages dynamic ad insertion streams.


Base interface for managing ads. Subclassed by AdsManager for directly requested ads and StreamManager for dynamic ad insertion streams.

Summary

Public functions

Unit

Registers a listener for errors that occur during the ad or stream initialization and playback.

Unit

Registers a listener for ad events that occur during ad or stream initialization and playback.

Unit

Stops the ad and all tracking, then releases all assets that were loaded to play the ad.

Unit

Generic focus endpoint that puts focus on the skip button if present.

AdProgressInfo!

Returns the latest AdProgressInfo for the current playing ad.

Ad!

Get currently playing ad.

Unit

Initializes the ad experience using default rendering settings.

Unit

Initializes the ad experience on the manager.

Unit

Removes a listener for error events.

Unit

Removes a listener for ad events.

Inherited functions

From com.google.ads.interactivemedia.v3.api.player.AdProgressProvider
VideoProgressUpdate!

Returns VideoProgressUpdate describing playback progress of the current ad or VideoProgressUpdate#VIDEO_TIME_NOT_READY if video details are not yet available.

Public functions

addAdErrorListener

fun addAdErrorListener(errorListener: AdErrorEvent.AdErrorListener!): Unit

Registers a listener for errors that occur during the ad or stream initialization and playback.

addAdEventListener

fun addAdEventListener(adEventListener: AdEvent.AdEventListener!): Unit

Registers a listener for ad events that occur during ad or stream initialization and playback.

destroy

fun destroy(): Unit

Stops the ad and all tracking, then releases all assets that were loaded to play the ad.

focus

fun focus(): Unit

Generic focus endpoint that puts focus on the skip button if present. If not present, focus is put on interactive elements, including icons or interactive creatives.

getAdProgressInfo

fun getAdProgressInfo(): AdProgressInfo!

Returns the latest AdProgressInfo for the current playing ad. Ad progress info will be available after AD_PROGRESS is broadcast and only between AD_BREAK_STARTED and AD_BREAK_ENDED. When unavailable this will return null.

getCurrentAd

fun getCurrentAd(): Ad!

Get currently playing ad.

init

fun init(): Unit

Initializes the ad experience using default rendering settings.

init

fun init(settings: AdsRenderingSettings!): Unit

Initializes the ad experience on the manager. This will load an ad and eventually send the LOADED event, indicating the ad is ready to be started. If an ads list is loaded, this method will start playback.

removeAdErrorListener

fun removeAdErrorListener(errorListener: AdErrorEvent.AdErrorListener!): Unit

Removes a listener for error events.

removeAdEventListener

fun removeAdEventListener(adEventListener: AdEvent.AdEventListener!): Unit

Removes a listener for ad events.