OGPlayer Web SDK
    Preparing search index...

    Interface AdsProviderCallbacks

    Events an AdsProvider reports back to the player — the web counterpart Implemented by OGPlayer. In addition to the ad lifecycle, the provider drives content pause/resume (client-side ads play while the content element is paused).

    interface AdsProviderCallbacks {
        onAdBreakCompleted(breakType: AdBreakType): void;
        onAdBreakStarted(breakType: AdBreakType, totalAds: number): void;
        onAdClicked?(ad: AdInfo): void;
        onAdCompleted(ad: AdInfo): void;
        onAdCuePoints(cuePointsSeconds: number[]): void;
        onAdError(error: OGAdError): void;
        onAdPaused(ad: AdInfo): void;
        onAdProgress(ad: AdInfo, positionMs: number, durationMs: number): void;
        onAdResumed(ad: AdInfo): void;
        onAdSkipped(ad: AdInfo): void;
        onAdStarted(ad: AdInfo): void;
        onAdTapped?(ad: AdInfo): void;
        onAdUiDialogChanged?(open: boolean): void;
        onAllAdsCompleted?(): void;
        onContentPauseRequested(): void;
        onContentResumeRequested(): void;
    }
    Index
    • The viewer opened the ad's clickthrough: a new tab/window covers the page. The SDK pauses the ad and resumes it when the page is visible again. Optional.

      Parameters

      Returns void

    • VMAP cue-point times (seconds into content; negative = postroll).

      Parameters

      • cuePointsSeconds: number[]

      Returns void

    • Parameters

      • ad: AdInfo
      • positionMs: number
      • durationMs: number

      Returns void

    • The viewer tapped/clicked the ad itself — not its skip, clickthrough or AdChoices control. Providers that own the layer over the video (IMA) report it and the SDK toggles the ad's playback; a provider that draws nothing there never needs to (the stage click handles that). Optional.

      Parameters

      Returns void

    • The provider's own dialog opened (true) or closed (false) — IMA's "About this ad" on a TV. While it is open the SDK's remote chrome steps aside and leaves every key to the provider. Optional; the mobile onAdUiDialogChanged.

      Parameters

      • open: boolean

      Returns void

    • The whole ad schedule for this session finished (no breaks remain).

      Returns void

    • A break is about to play — pause and hide the content.

      Returns void

    • The break finished — resume content.

      Returns void