Package-level declarations

Types

Link copied to clipboard
interface AdBreakConfig

Per-item ad configuration, interpreted by the player's active AdsProvider. The config type must match the provider the player was built with: AdTagConfig for VAST/VMAP tag providers (ImaAdsProvider — including a FreeWheel ad server answering in VMAP), or a provider-defined implementation from an ads module (e.g. FreewheelConfig from ogplayer-ads-freewheel). A mismatch surfaces AdListener.onAdError and content plays without ads.

Link copied to clipboard

Position of an ad break relative to the content.

Link copied to clipboard
class AdInfo(val adId: String, val positionInPod: Int, val podSize: Int, val breakType: AdBreakType, val isSkippable: Boolean, val skipOffsetMs: Long, val durationMs: Long, val clickThroughUrl: String? = null, val providerRendersUi: Boolean = false)

Metadata of a single ad, including its position in the pod.

Link copied to clipboard
interface AdListener

App-facing callbacks for ad playback events. All methods have empty defaults.

Link copied to clipboard
interface AdsProvider

SPI base for ad-insertion implementations. Apps construct a provider from an ads module and pass it to OGPlayer.Builder.setAdsProvider — exactly one provider per player. Providers come in two styles:

Link copied to clipboard

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

Link copied to clipboard
class AdTagConfig(val adTagUri: String) : AdBreakConfig

A VAST/VMAP ad tag, consumed by Media3-timeline providers (IMA).

Link copied to clipboard
class OGAdError(val code: Int, val phase: OGAdError.Phase, val message: String)

Structured ad failure. Content playback always continues after an ad error — this is reporting, never fatal.

Link copied to clipboard
interface SlotAdsHost

Implemented by the SDK core; a SlotAdsProvider's handle on the content transport. All methods must be called on the application main thread.

Link copied to clipboard

Providers that play ads in their own renderer over the content surface (FreeWheel). Content pauses underneath; the SDK core orchestrates the session through SlotAdsHost and receives events through SlotAdsProviderCallbacks.

Link copied to clipboard

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

Link copied to clipboard

Providers that splice ads into the Media3 timeline (IMA). The content engine plays the ad media; the provider supplies the Media3 ads loader.