OptiView Ads SDK
    Preparing search index...

    Interface OptiViewAdsConfig

    SDK instance configuration, fixed for its lifetime (org-level).

    interface OptiViewAdsConfig {
        adBreakCutSafetyMarginSec?: number;
        adInsertion?: AdInsertionMode;
        adPreload?: AdPreloadMode;
        autoplay?: boolean;
        breakWarnings?: BreakWarningsConfig;
        chaining?: ChainingConfig;
        container: HTMLElement;
        continueContentDuringBreak?: boolean;
        createAdAdapter?: CreateAdAdapter;
        debug?: boolean;
        diagnostics?: DiagnosticsConfig;
        doubleBoxAudio?: DoubleBoxAudio;
        gam?: GamConfig;
        interceptManifestRequest?: ManifestRequestInterceptor;
        interceptManifestResponse?: ManifestResponseInterceptor;
        maxBitrate?: number;
        mode?: OptiViewAdsMode;
        pdtGraceSeconds?: number;
        player: PlayerAdapter;
        playerContainer?: HTMLElement;
        ptsSource?: PtsSource;
        ssai?: SsaiConfig;
        tuneIn?: TuneInConfig;
    }
    Index
    adBreakCutSafetyMarginSec?: number

    Seconds added to a break's effective duration to form the hard cut back to content, so an over-long or stalled ad cannot hold the break open. 0 cuts exactly at the boundary.

    2
    
    adInsertion?: AdInsertionMode

    Ad insertion strategy. auto switches iPhone/iPod to shared-element insertion, all other platforms overlay.

    'auto'
    

    AdInsertionMode

    adPreload?: AdPreloadMode

    Ad preload strategy.

    'auto'
    

    AdPreloadMode

    autoplay?: boolean

    Start playback automatically after loading the stitched master (SSAI only).

    false
    
    breakWarnings?: BreakWarningsConfig

    Pre-break warnings: adbreakstatus events N seconds before each non-pre-roll break.

    BreakWarningsConfig

    chaining?: ChainingConfig

    Consecutive-break chaining. Defaults to enabled with a 2s gap.

    ChainingConfig

    container: HTMLElement

    Outer stage element containing the customer's player and all SDK-managed ad elements. The SDK appends its elements here and sets position:relative if not already set.

    continueContentDuringBreak?: boolean

    Keep content playing, muted and hidden, through eligible replacement single-format breaks. Requires SGAI and an explicit adInsertionType: 'replacement'. The content player's optional setVideoQuality operation constrains background bandwidth when available.

    false
    
    createAdAdapter?: CreateAdAdapter

    Factory for a custom ad player, given an SDK-created container. Optional with @dolby-optiview/ads-sdk, which includes a default player for progressive video and HLS. Required when using the bare @dolby-optiview/ads-sdk-core package.

    createAdAdapter: (container) => {
    const video = document.createElement('video');
    container.appendChild(video);
    const hls = new Hls(); hls.attachMedia(video);
    return new HlsJsAdapter(hls, video);
    }
    debug?: boolean

    Enable debug logging.

    false
    
    diagnostics?: DiagnosticsConfig

    Ring buffer behind onDiagnostic() and exportDiagnostics().

    doubleBoxAudio?: DoubleBoxAudio

    Which side gets audio during a double-format break; the other side is muted for the break.

    'ad'
    

    DoubleBoxAudio

    gam?: GamConfig

    Google Ad Manager configuration. Its PRESENCE enables GAM. It carries no stream identity: in sgai that comes from the manifest's vendorConfiguration, in ssai from ssai + customAssetKey.

    interceptManifestRequest?: ManifestRequestInterceptor

    Hook on the manifest HTTP request (redirect, headers, or a mocked body). On throw the SDK emits DA-MANIFEST-REQUEST-INTERCEPT-FAILED and fetches normally. See ManifestRequestInterceptor.

    interceptManifestResponse?: ManifestResponseInterceptor

    Hook on the parsed manifest before scheduling (initial fetch and every poll). See ManifestResponseInterceptor.

    maxBitrate?: number

    Maximum rendition bitrate (bits/sec) sent to the stitcher as max_bitrate; variants above it are dropped. SSAI only.

    Ad insertion architecture. With ssai, gam and ssai are both required and each session supplies stitcherUrl + customAssetKey.

    'sgai'
    

    OptiViewAdsMode

    pdtGraceSeconds?: number

    Seconds to wait for EXT-X-PROGRAM-DATE-TIME on a wallclock session before concluding the stream carries none. Until then no scheduling decision is made: the system clock runs ahead of the live playhead by the stream latency and would fire a break early.

    A backstop, not a fixed delay: content playing for ~1s with no PDT concludes immediately (DA-PDT-MISSING); the window only governs a player that never starts. Set 0 to use the system clock immediately. No effect on pts manifests.

    5
    

    The content player adapter; the SDK only interacts with the player through it.

    playerContainer?: HTMLElement

    Inner wrapper around the customer's player UI, repositioned to a pip corner during lshape breaks. Must be a child of container. If omitted the SDK wraps the existing children itself.

    ptsSource?: PtsSource

    How a timebase: "pts" break's start is resolved. mediaTime reads it directly as player media time. anvatoCue tracks Anvato in-stream cues — HLS ID3 GEOB frames (description Anvatos, MIME application/json) and DASH emsg (urn:anvato:es1:052016) with payload type=cue&pts=<seconds> — and schedules the break at the media time of the cue whose pts matches its start (±5 ms); until then it stays pending (DA-ANVATO-CUE-PENDING). SGAI only.

    'mediaTime'
    
    ssai?: SsaiConfig

    SSAI-only GAM identity (required with mode: 'ssai'): SSAI has no break manifest to read it from.

    tuneIn?: TuneInConfig

    Tune-in (join-in-progress) configuration. Defaults to enabled with a 5s minimum.

    TuneInConfig