OGPlayer Web SDK
    Preparing search index...

    Interface AdsProvider

    SPI for a client-side ads integration (Google IMA HTML5, future slot providers) — the web mirror of the mobile AdsProvider SPI. Opt-in: apps that never touch ads load none of this.

    interface AdsProvider {
        usesContentVideoElement?: boolean;
        attach(
            video: HTMLVideoElement,
            adContainer: HTMLElement,
            callbacks: AdsProviderCallbacks,
        ): void;
        click(): void;
        contentDidComplete(): void;
        destroy(): void;
        pause(): void;
        requestAds(config: AdBreakConfig, autostart: boolean): void;
        resize(width: number, height: number, fullscreen: boolean): void;
        resume(): void;
        skip(): void;
        startPendingBreak(): boolean;
    }

    Implemented by

    Index
    usesContentVideoElement?: boolean

    True when the provider plays its ads IN the content video element (FreeWheel's HTML5 SDK design — it swaps the src and the player restores content afterwards). The engine then releases the media element around each break and reloads content at the saved position when the break completes.

    • Wire the provider to the content element and the ad UI container. Called once before the first requestAds.

      Parameters

      Returns void

    • Content reached its end (so VMAP postrolls fire).

      Returns void

    • Request ads for the item's config. autostart carries the content's autoplay intent: false = hold the break until startPendingBreak().

      Parameters

      Returns void

    • The player/container was resized (fullscreen, layout).

      Parameters

      • width: number
      • height: number
      • fullscreen: boolean

      Returns void

    • Start a loaded-but-held break. True if one was started.

      Returns boolean