The shaka.Player (or anything satisfying ShakaPlayerLike).
The <video> element the content plays in.
Current playback time in seconds.
Total duration of the content in seconds.
Shaka answers this directly, so there is nothing to infer.
Guarded like every other optional member on ShakaPlayerLike: an integrator may hand us
a partial player, and a missing method must degrade to "cannot say" rather than throw
inside a break.
Latest 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.
Whether the player is muted.
Settable so the SDK can sync mute state between content and ad players.
Whether the player is currently paused.
Playback rate, 1 being normal speed.
Reads the element rather than a remembered value: with streaming.liveSync enabled Shaka
adjusts the rate itself to hold its target latency, and the SDK needs to see that so it
stops correcting rather than fighting it.
Playback 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.
Program Date Time of the current playback position, anchored on the
manifest's EXT-X-PROGRAM-DATE-TIME (getInitialProgramDateTime). Returns
null for VOD or when the manifest carries no PDT: Shaka then synthesizes a
presentation start (getPresentationStartTime) that trails wallclock by the
live delay, which would misplace wallclock breaks — the core's own
wallclock fallback is the right answer there, as with the other adapters.
The manifest Shaka currently has. Shaka attaches a MediaSource, so the element's src
is a blob: and cannot be reloaded; getAssetUri() is the real answer and stays right
even when the application loaded the source through the player directly.
The underlying HTMLVideoElement. Exposed so the SDK can pass it to GAM.
Volume level in the range [0, 1].
Volume in [0, 1]; settable so the SDK can sync it between content and ad players.
Clean up resources.
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.
Resume playback.
Let go of the <video> so the SDK can play an ad through it (shared-element insertion).
Shaka does not tolerate sharing: with the player still attached, its MediaSource and the ad engine's compete for the same element, and the ad either aborts outright or loops on its first segment.
detach() rather than destroy(): the same player instance takes the element back at
break end, when the SDK calls load() with the saved content source — and load()
re-attaches when it finds the element is no longer Shaka's.
Seek to a specific time in seconds.
Set the requested video quality, or restore the selection in force before the first set. Returns whether an override was applied or an outstanding override was restored.
Selecting a Shaka variant does not stop ABR, so the lowest request suspends ABR before
selecting. clearBuffer is explicitly false, preserving the non-interrupting switch after
buffered content has played. Missing optional APIs degrade to no quality change.
The PlayerAdapter for Shaka Player, from the
@dolby-optiview/ads-sdk-adapter-shakapackage (peer dependency:shaka-player4 or 5).Preferred usage — create the Player WITHOUT passing the video element to the constructor (avoids Shaka's deprecated eager-MediaSource-init path which can interfere with the ad video element's CSS rendering):
Example
If you pass the video element to the constructor (legacy/deprecated pattern), ShakaAdapter still works —
load()re-attaches only when the player is attached elsewhere.