OGPlayer Web SDK
    Preparing search index...

    Class OGPlayer

    The OGPlayer playback engine — the web counterpart of the Android OGPlayer (the reference platform), wrapping an HTML <video> element: HLS via hls.js (MSE) everywhere, natively on Safari, progressive files directly. UI is <og-player> from the ui module; the engine also works fully headless.

    Index
    adsProvider: AdsProvider | null = null

    Opt-in client-side ads integration (e.g. ImaAdsProvider). Set before load()ing an item with adBreaks.

    holdPlayback: boolean = false

    While true, nothing may start playback — play() and every internal resume path no-op. Used by the hard ad-block policy; equally useful for host-side gates (paywalls, age gates).

    subtitleStyle: SubtitleStyle = ...
    subtitleTextScale: number = 1.0
    videoElement: HTMLVideoElement
    volumeControlMode: VolumeControlMode = "PLAYER"

    Web routes all volume to the element; kept for API parity.

    • get adCuePoints(): number[]

      VMAP cue-point times in seconds (negative = postroll).

      Returns number[]

    • get adCuePositionsMs(): number[]

      Ad-break cue positions in ms, Android encoding (postroll = duration).

      Returns number[]

    • get adProgress(): | {
          adCount: number;
          adIndex: number;
          durationMs: number;
          positionMs: number;
      }
      | null

      Progress of the current ad (drives the yellow ad bar), or null.

      Returns
          | {
              adCount: number;
              adIndex: number;
              durationMs: number;
              positionMs: number;
          }
          | null

    • get adsPending(): boolean

      True between an autoplay load-with-ads and the first provider verdict (content pause OR resume) — the UI keeps controls hidden meanwhile.

      Returns boolean

    • get hasThumbnails(): boolean

      True when the current item carries a storyboard (trick-play) track.

      Returns boolean

    • Supplied by <og-player>: the element IMA renders its ad UI into.

      Parameters

      • el: HTMLElement

      Returns void

    • The storyboard frame covering positionMs, or null (mobile parity: getThumbnail). The frame is a crop within a sprite image.

      Parameters

      • positionMs: number

      Returns Promise<ThumbnailFrame | null>

    • The player surface was resized — keep the ad UI matched.

      Parameters

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

      Returns void

    • Parameters

      • cb: (licensed: boolean) => void

      Returns void

    • Reloads the last loaded item after a fatal error — VOD resumes at the last healthy playback position, live streams rejoin at the edge. The built-in error overlay's Retry button calls this; hosts building their own UI can too. No-op before the first load().

      Returns void

    • Parameters

      • positionMs: number

      Returns void

    • Parameters

      • id: string | null

      Returns void