SlotAdsProviderCallbacks

Superset of AdsProviderCallbacks for slot providers. Implemented by the SDK core; must be called on the application main thread.

Functions

Link copied to clipboard
abstract fun onAdBreakCompleted(breakType: AdBreakType)
Link copied to clipboard
abstract fun onAdBreakStarted(breakType: AdBreakType, totalAds: Int)
Link copied to clipboard
open fun onAdClicked(ad: AdInfo)

The viewer opened the ad's clickthrough ("Learn more"): the browser is about to cover the app. The SDK pauses the ad — otherwise it plays on, audio included, behind the advertiser's page — and resumes it when the app comes back to the foreground. Default no-op.

Link copied to clipboard
abstract fun onAdCompleted(ad: AdInfo)
Link copied to clipboard
abstract fun onAdCuePointsChanged(cuePositionsMs: List<Long>, hasPostroll: Boolean)

Remaining (unplayed) midroll positions in content time, plus whether a postroll slot exists (core appends the content duration as its cue). Called after the ad request completes and again whenever a slot is consumed.

Link copied to clipboard
abstract fun onAdError(error: OGAdError)
Link copied to clipboard
abstract fun onAdPaused(ad: AdInfo)
Link copied to clipboard
abstract fun onAdProgress(ad: AdInfo, positionMs: Long, durationMs: Long)

Playback progress of the current ad (drives the chrome countdown).

Link copied to clipboard
abstract fun onAdResumed(ad: AdInfo)
Link copied to clipboard
abstract fun onAdSkippableStateChanged(ad: AdInfo, isSkippable: Boolean, skipOffsetMs: Long)

The current ad's skippable state changed.

Link copied to clipboard
abstract fun onAdSkipped(ad: AdInfo)
Link copied to clipboard
abstract fun onAdStarted(ad: AdInfo)
Link copied to clipboard
open fun onAdTapped(ad: AdInfo)

The viewer tapped the ad itself — not its skip, clickthrough or AdChoices control. Providers that own the layer over the video (IMA) report the tap here and the SDK toggles the ad's playback; a provider that draws nothing over the video never needs to — the SDK's own surface handles that tap. Default no-op: existing providers stay source- and binary-compatible.

Link copied to clipboard

The provider opened or closed a dialog of its own UI (IMA: the "About this ad" fallback dialog on TVs). Lets the SDK's remote chrome send Back to the dialog first instead of stepping out from under it.

Link copied to clipboard
abstract fun onAllAdsCompleted()

Postrolls finished (or none existed) after onContentEnded — core now reports playback completion to the app.