ReferenceMedia
shaka-video
UnstableVideo element powered by Shaka Player for DASH, HLS, and progressive playback with DRM
Choose Shaka Player when one media component needs to play DASH, HLS, and progressive files, or when playback requires DRM.
Import
Or load it from the CDN:
Load a source
src takes a manifest URL. DASH, HLS, and progressive files all go through the same property, and Shaka picks the parser from the URL.
When the URL carries no extension to go on, name the type with source.type. That’s what makes an extensionless manifest playable.
Protected content
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 undersource.engine.shaka. preload="none"defers the load until playback is asked for;autoplayor aplay()counts as asking.preload="metadata"loads, then holds Shaka’s buffering goals down to a second untilpreloadrises toauto.streamTypeis detected from the manifest, so a player skin renders live and on-demand content correctly without being told which it is.- Changing
source.engine.shakareconfigures the running player in place instead of recreating it.
Examples
Basic Usage
API Reference
Attributes
Forwards these standard media attributes to the internal <video>. See the MDN media element reference: autopictureinpictureautoplaycontrolscontrolslistcrossorigindisablepictureinpicturedisableremoteplaybackloadingloopmutedplaysinlineposterpreloadsrc
These Video.js-specific attributes configure media behavior:
Properties
Also exposes these properties from the native media API. See HTMLVideoElement for details: autoplaybufferedcontrolscrossOrigincurrentSrccurrentTimedefaultMuteddefaultPlaybackRatedisablePictureInPicturedisableRemotePlaybackdurationendedloopmutedpausedplaybackRateplayedplaysInlineposterreadyStateremoteseekableseekingtextTrackstitlevideoHeightvideoWidthvolume
Methods
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: