source.drm names your license servers, keyed by EME key system id. Name every system you hold a license server for: which one gets negotiated is the browser’s choice.
FairPlay needs a serverCertificateUrl unless its CDM is pre-provisioned; Widevine and PlayReady ignore it. source.drm takes the same shape as hls.js’s own drmSystems, so one object describes DRM for either engine.
For the parts of Shaka’s DRM configuration this doesn’t cover, configure Shaka directly. A drm.servers under source.engine.shaka replaces source.drm rather than merging with it.
Behavior
Adaptation stays within renditions no larger than the element rendering them, through Shaka’s abr.restrictToElementSize. Override it under source.engine.shaka.
preload="none" defers the load until playback is asked for; autoplay or a play() counts as asking.
preload="metadata" loads, then holds Shaka’s buffering goals down to a second until preload rises to auto.
streamType is detected from the manifest, so a player skin renders live and on-demand content correctly without being told which it is.
Changing source.engine.shaka reconfigures the running player in place instead of recreating it.
Examples
Basic Usage
import { ShakaVideo } from '@videojs/react/media/shaka-video';export default function BasicUsage() { return <ShakaVideo className="shaka-video" src="https://dash.akamaized.net/akamai/streamroot/050714/Spring_4Ktest.mpd" autoPlay muted playsInline loop />;}
Forwards these standard media attributes to the internal <video>. See the MDN media element reference: autopictureinpictureautoplaycontrolscontrolslistcrossorigindisablepictureinpicturedisableremoteplaybackloadingloopmutedplaysinlineposterpreloadsrc
These Video.js-specific attributes configure media behavior:
Attribute
Type
Default
Details
stream-type
MediaStreamType
"unknown"
Properties
Property
Type
Default
Details
contentData
MediaContentData | undefined
—
Description
Read-only.
engine
shaka.Player | null
—
Description
Read-only. Underlying playback engine — the Shaka Player instance, or null when the browser cannot run it. An advanced
escape hatch for direct engine access; normal playback is driven through this element's own properties and
methods.
error
unknown
—
Description
Read-only. The last playback failure Shaka could not recover from, or null. Shaka loads asynchronously, so a manifest that
cannot be played fails after src was assigned rather than at the assignment; the error event is when to read
this.
A Shaka failure says more about what went wrong than the media element's own error does, so it wins while there
is one; anything the element failed on by itself still reads through.
isFullscreen
boolean
—
Description
Read-only.
isPictureInPicture
boolean
—
Description
Read-only.
liveEdgeStart
number
—
Description
Read-only.
preload
MediaPreloadType
'metadata'
Description
How much to fetch before playback is asked for, mirroring the media element's own preload. Shaka has no split
between "know the source" and "buffer it", so this maps onto when and how engine.load() runs:
'auto' — load immediately with the configured buffering goals.
'metadata' — load immediately, holding buffering to about a segment; the configured goals come back on the first
play intent.
'none' / '' — hold the load entirely until the first play intent.
A play intent is a play event, a target that is already playing, or autoplay — which the spec lets override
preload for good reason: with nothing fetched there is nothing whose readiness could ever fire it. Widening
(none → auto) takes effect immediately; narrowing after a load began cannot un-fetch and leaves it alone.
Also exposes these properties from the native media API. See HTMLVideoElement for details: autoplaybufferedcontrolscrossOrigincurrentSrccurrentTimedefaultMuteddefaultPlaybackRatedisablePictureInPicturedisableRemotePlaybackdurationendedloopmutedpausedplaybackRateplayedplaysInlineposterreadyStateremoteseekableseekingtextTrackstitlevideoHeightvideoWidthvolume
Engine options
source.engine.shaka
Pass Shaka Player’s own configuration here. It’s handed to Shaka untouched, so every option in its configuration reference works, spelled the way Shaka spells it. Replacing the object resets any configuration applied before it. Media Sources covers how engine options fit into a structured source.
Each entry below is a group of Shaka settings rather than a single value, and Shaka documents what’s inside them. The names and types come from Shaka’s own type definitions.
Supports these media methods. See HTMLVideoElement for details: addTextTrackcanPlayTypeexitFullscreenexitPictureInPictureloadpauseplayrequestFullscreenrequestPictureInPicture
Events
Re-dispatches these standard media events from the internal media element: abortaddtrackcanplaycanplaythroughchangecontentdatachangedurationchangeemptiedendedenterpictureinpictureleavepictureinpictureloadeddataloadedmetadataloadstartpauseplayplayingprogressratechangeremovetrackresizeseekedseekingstalledsuspendtimeupdatevolumechangewaiting
Also emits these Video.js-specific events:
Event
Description
error
Fired when playback fails in a way Shaka could not recover from. Read `error` for the failure.
sourcechange
Fired when `source` changes, either directly or by resolving a new `src`. Read `source` for the
new value.
streamtypechange
Fired when the detected stream type changes. Read `streamType` for the new value.
targetlivewindowchange
Fired when `targetLiveWindow` changes. Read it for the new value.