AdsProviderCallbacks

Implemented by the SDK core; ads providers report their events through it. Must be called on the application main thread.

Inheritors

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 onAdError(error: OGAdError)
Link copied to clipboard
abstract fun onAdPaused(ad: AdInfo)
Link copied to clipboard
abstract fun onAdResumed(ad: AdInfo)
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.