OptiViewAdsConfig

data class OptiViewAdsConfig(val player: PlayerAdapter, val adPreload: AdPreloadMode = AdPreloadMode.AUTO, val doubleBoxAudio: DoubleBoxAudio = DoubleBoxAudio.AD, val adInsertion: AdInsertionMode = AdInsertionMode.AUTO, val transition: TransitionConfig = TransitionConfig(), val chaining: ChainingConfig = ChainingConfig(enabled = true, maxGapSeconds = 2.0), val tuneIn: TuneInConfig = TuneInConfig(enabled = true, minBreakDurationSeconds = 5.0), val breakWarnings: BreakWarningsConfig = BreakWarningsConfig(), val pdtGraceSeconds: Double = DEFAULT_PDT_GRACE_SECONDS, val ptsSource: PtsSource = PtsSource.MEDIA_TIME, val continueContentDuringBreak: Boolean = false, val diagnostics: DiagnosticsConfig = DiagnosticsConfig(), val debug: Boolean = false, val gam: GamConfig? = null, val deliveryMode: DeliveryMode? = null, val adBreakCutSafetyMarginSec: Double = DEFAULT_AD_BREAK_CUT_SAFETY_MARGIN_SEC, val interceptManifestResponse: ManifestResponseInterceptor? = null, val interceptManifestRequest: ManifestRequestInterceptor? = null)

Org-level SDK configuration, fixed for the lifetime of the OptiViewAds instance. Chaining uses the brain's already-resolved ChainingConfig; the default below matches the web DEFAULT_CHAINING (enabled, 2s gap). tuneIn matches the web DEFAULT_TUNE_IN (enabled, 5s minimum remaining duration).

Constructors

Link copied to clipboard
constructor(player: PlayerAdapter, adPreload: AdPreloadMode = AdPreloadMode.AUTO, doubleBoxAudio: DoubleBoxAudio = DoubleBoxAudio.AD, adInsertion: AdInsertionMode = AdInsertionMode.AUTO, transition: TransitionConfig = TransitionConfig(), chaining: ChainingConfig = ChainingConfig(enabled = true, maxGapSeconds = 2.0), tuneIn: TuneInConfig = TuneInConfig(enabled = true, minBreakDurationSeconds = 5.0), breakWarnings: BreakWarningsConfig = BreakWarningsConfig(), pdtGraceSeconds: Double = DEFAULT_PDT_GRACE_SECONDS, ptsSource: PtsSource = PtsSource.MEDIA_TIME, continueContentDuringBreak: Boolean = false, diagnostics: DiagnosticsConfig = DiagnosticsConfig(), debug: Boolean = false, gam: GamConfig? = null, deliveryMode: DeliveryMode? = null, adBreakCutSafetyMarginSec: Double = DEFAULT_AD_BREAK_CUT_SAFETY_MARGIN_SEC, interceptManifestResponse: ManifestResponseInterceptor? = null, interceptManifestRequest: ManifestRequestInterceptor? = null)

Properties

Link copied to clipboard

Safety margin, in seconds, added to a break's effective duration to form the hard cut-off at which the SDK always returns to content — regardless of whether the inserted ad media has reached its own end. Set to 0.0 to cut exactly at the break boundary. Mirrors the web adBreakCutSafetyMarginSec.

Link copied to clipboard

Ad insertion strategy; defaults to AdInsertionMode.AUTO, which resolves to overlay on Android.

Link copied to clipboard

Ad preload strategy; defaults to AdPreloadMode.AUTO, matching the web DEFAULT_AD_PRELOAD_MODE. Android has no browser UA, so auto resolves to AdPreloadMode.PARALLEL unless the adapter reports supportsParallelBuffering == false — with the AUTO default that capability hint is authoritative without any configuration.

Link copied to clipboard

Pre-break warning thresholds (seconds before a non-pre-roll break) at which the SDK emits an adbreakstatus with phase = upcoming. Defaults to none. Mirrors the web breakWarnings config. See BreakWarningsConfig.

Link copied to clipboard

Consecutive-break chaining; defaults to on with a 2-second gap.

Link copied to clipboard

Keep the content player PLAYING through an eligible replacement break instead of pausing it and seeking back afterwards.

Link copied to clipboard

Whether to log verbose diagnostics and attribute break-transition sub-phases.

Link copied to clipboard

Pin this session's delivery architecture instead of letting the break manifest's delivery rules steer it (ADS-326).

Link copied to clipboard

Structured diagnostics settings.

Link copied to clipboard

Which side keeps audio during a double-format break: the ad (default) or content.

Link copied to clipboard

Google Ad Manager pod-serving settings; null when the app does not wire IMA.

Link copied to clipboard

Optional hook to inspect/modify the manifest HTTP request before the SDK fetches it (initial fetch and every poll). Can redirect the URL, add headers, or short-circuit the network with a mocked raw body (parsed + validated normally). May suspend. On throw emits DA-MANIFEST-REQUEST-INTERCEPT-FAILED and falls back to the normal network fetch. See ManifestRequestInterceptor. The SDK forwards it to the ManifestSource; the default HttpManifestSource applies it.

Link copied to clipboard

Optional hook to inspect/modify the break manifest after the SDK fetches and validates it, before it is scheduled. Receives the typed, parsed BreakManifest (initial fetch and every poll) and returns the manifest to use. May suspend. See ManifestResponseInterceptor. The SDK forwards it to the ManifestSource; the default HttpManifestSource applies it.

Link copied to clipboard

How long, in seconds, to wait for the stream's EXT-X-PROGRAM-DATE-TIME on a wallclock-timebase session before concluding the stream carries none.

Link copied to clipboard

The adapter around the application's content player.

Link copied to clipboard

Selects how timebase: "pts" break starts are resolved. PtsSource.MEDIA_TIME uses the manifest start directly. PtsSource.ANVATO_CUE tracks Anvato timed-metadata cues from the content player — HLS ID3 GEOB frames with description Anvatos (MIME application/json) and DASH emsg events with scheme urn:anvato:es1:052016 — whose payload is a query string of the form type=cue&pts=<seconds>. A PTS break is then scheduled at the media time of the observed cue whose pts matches the break's start (±5 ms); a break whose cue has not been observed yet stays pending (surfaced once per break via the DA-ANVATO-CUE-PENDING diagnostic). SGAI only; has no effect on wallclock-timebase manifests. Mirrors the web ptsSource. Defaults to PtsSource.MEDIA_TIME.

Link copied to clipboard

How the picture changes at the edges of a break; see TransitionConfig.

Link copied to clipboard

Tune-in (join-in-progress); defaults to on with a 5-second minimum remaining duration.