ReadonlycurrentCurrent playback time in seconds.
ReadonlydurationContent duration in seconds; may be Infinity for live streams.
Optional ReadonlyisWhether the content is live, as reported by the player engine. Return null or omit
this property when unknown; the SDK then falls back to checking for an infinite duration.
A finite duration does not reliably identify VOD: HLS.js can report a finite live playlist.
| Player | Live status |
|---|---|
| HLS.js | hls.latestLevelDetails.live |
| Shaka | player.isLive() |
| THEOplayer | duration === Infinity |
Do not infer live status from maxLiveSeekPosition; a seek range can exist for VOD too.
Optional ReadonlyliveEnd of the newest published media segment in seconds (the live edge), or null when unknown.
Report this when the engine's seekable range stops short of the published playlist end;
AVFoundation, for example, ends seekableTimeRanges one hold-back before the edge. If omitted,
the live start positioning uses seekableEnd as the edge.
Optional ReadonlymaxLatest live playback position the player can seek to without moving back to maintain
its minimum live offset, in seconds. Return null when unknown or not live; the SDK
then leaves the seek target unclamped. Use the player engine's seek limit rather than
guessing an offset: HLS.js exposes liveSyncPosition, THEOplayer exposes
latencyManager.currentLatency / minimumOffset, and Shaka exposes
seekRange() / safeSeekEndOffset.
Settable so the SDK can sync mute state between content and ad players.
ReadonlypausedWhether the player is paused.
OptionalplaybackPlayback rate (1 = normal). Used to correct drift while content continues behind an
ad with continueContentDuringBreak. Report the engine's current rate, not just the last
assigned value, so the SDK can detect changes made by the player's live-latency controller.
If omitted, drift is reported but not corrected.
Optional ReadonlyplaybackFalse while play expresses intent but the content timeline is not yet ready for a startup seek.
ReadonlyprogramProgram Date Time (HLS EXT-X-PROGRAM-DATE-TIME) for wallclock break matching; null if unavailable.
Optional ReadonlyseekableEnd of the available media in seconds, or null when unknown. This differs from
maxLiveSeekPosition, which includes the player's minimum live offset.
Read the engine's seek range if the video element reports an unbounded sentinel value
instead of the actual DVR window. If omitted, the SDK uses videoElement.seekable
and rejects sentinel values.
Optional ReadonlyseekableStart of the same seekable range as seekableEnd; null/omitted when unknown.
Optional ReadonlysourceCurrent content manifest URL, used to restore content after a shared-element ad.
Read it from the player engine, not the element's src (which can be a blob: URL)
or the last load() argument, since applications may load sources directly.
Return null when unavailable; shared-element insertion is then unsupported
(DA-SHARED-ELEMENT-UNSUPPORTED).
Optional ReadonlysupportsOptional capability hint: can content and ad pipelines buffer in parallel without decoder
contention? false prevents continued content playout during a break. Undefined counts as capable.
Optional ReadonlytargetDeclared HLS EXT-X-TARGETDURATION in seconds, not average segment length; null when unknown.
Optional ReadonlyvideoThe underlying HTMLVideoElement, if any. Required for GAM (the IMA SDK needs the element).
Volume in [0, 1]; settable so the SDK can sync it between content and ad players.
Clean up resources when the SDK is destroyed.
Load a media source without playing; resolves when it is ready to play. Used to preload ads.
Unsubscribe from player events.
Subscribe to player events.
Pause playback (called when an ad break starts).
Resume playback (called when an ad break ends); resolves when playback starts.
OptionalpreloadOptional: warm caches (manifest, optionally the first fragment) WITHOUT attaching media or engaging a decoder, for single-decoder Smart TVs that cannot hold two MediaSources. Must not call attachMedia(). Leave undefined if unsupported; the SDK loads on demand at break start.
OptionalrecreateOptional: tear down and rebuild the engine's media pipeline (MediaSource / source buffers) for
the CURRENT source, positioned at startTime seconds. Called at break end on TVs that cannot
resume content in the MediaSource an ad interrupted (VIZIO SmartCast). Resolve once metadata
for the rebuilt pipeline is available; reject on failure — the SDK then falls back to seek+play.
Must not destroy the adapter. Omit when the engine has no such operation.
OptionalreleaseRelease control of the content video element so a shared-element ad can use it.
Resolve only when the element is free; do not destroy the adapter. The SDK restores
content with load() when the break ends. Omit this method if your player supports
sharing the element without an explicit release, as HLS.js does.
The same method is called on the ad adapter that createAdAdapter(container, video) built
for the content element, right before content is reloaded at break end. Leave the ad media
on the element there: the content engine's load() replaces it in one step, and an element
without a resource closes Safari's picture-in-picture window.
OptionalrequestAsk the engine to begin the upcoming live playback targetDurations declared target
durations behind the live edge, before the first frame, instead of the SDK seeking after it.
fallbackTargetDuration (seconds) applies when the engine cannot read the playlist's.
null withdraws the request. Return false when the engine cannot honour it for the
upcoming start; the SDK then seeks after the first frame. Omit when unsupported.
Seek to a time in seconds. Needed for snapback during locked breaks without touching the video element.
OptionalsetOptionally select a content quality, or pass null to release the SDK's override.
A successful lowest request snapshots the integrator's current selection and applies the
cheapest rendition without flushing buffered media. Returns whether the request was applied;
passing null restores the exact prior selection.
OptionalunloadRelease the held media without destroying the adapter; the next load() must reattach it.
Called on single-decoder TVs at break end, before content resumes, to free the hardware
decoder and avoid MEDIA_ERR_DECODE. Not called in parallel-preload mode.
When it returns a promise, the SDK awaits it before resuming content.
The abstraction layer between the SDK and any video player. The core only talks to players through this interface; each player gets its own adapter package.
Example