Skip to content
FrameworkStyle

dash-video

Beta

DASH video element powered by dash.js for adaptive bitrate streaming

DASH video element powered by dash.js for MPEG-DASH adaptive bitrate streaming.

Import

pnpm add @videojs/html @videojs/dash-video
import '@videojs/html/media/dash-video';

Or load it from the CDN:

<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.0.0-beta.32/media/dash-video.js"></script>

Examples

Basic Usage

<media-container class="media-container">
  <dash-video src="https://dash.akamaized.net/akamai/streamroot/050714/Spring_4Ktest.mpd" autoplay muted playsinline loop></dash-video>
</media-container>

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:

AttributeTypeDefaultDetails
stream-typeMediaStreamType

Properties

PropertyTypeDefaultDetails
contentDataMediaContentData | undefined
enginedashjs.MediaPlayerClass
isFullscreenboolean
isPictureInPictureboolean
liveEdgeStartnumber
source{ src?: string; engine?: DashEngineConfig } | nullnull
srcstring''
streamTypeMediaStreamType
targetLiveWindownumber
webkitCurrentPlaybackTargetIsWirelessboolean | undefined
webkitPresentationModeWebKitPresentationMode | undefined
webkitSetPresentationMode((mode: WebKitPresentationMode) => void) | undefined

Also exposes these properties from the native media API. See HTMLVideoElement for details: autoplaybufferedcontrolscrossOrigincurrentSrccurrentTimedefaultMuteddefaultPlaybackRatedisablePictureInPicturedisableRemotePlaybackdurationendederrorloopmutedpausedplaybackRateplayedplaysInlineposterpreloadreadyStateremoteseekableseekingtextTrackstitlevideoHeightvideoWidthvolume

Engine options

source.engine.dashJs

Pass dash.js’s own settings here. They’re handed to dash.js untouched, so every option in its settings reference works. Replacing the object resets any settings applied before it. Media Sources covers how engine options fit into a structured source.

Each of the three below is a group of dash.js settings rather than a single value, and dash.js documents what’s inside them.

const video = document.querySelector('dash-video');
video.source = {
  src: 'https://example.com/manifest.mpd',
  engine: { dashJs: { streaming: { buffer: { fastSwitchEnabled: true } } } },
};
OptionTypeDetails
debugobject
errorsobject
streamingobject

Methods

Supports these media methods. See HTMLVideoElement for details: addTextTrackcanPlayTypeexitFullscreenexitPictureInPictureloadpauseplayrequestFullscreenrequestPictureInPicture

Events

Re-dispatches these standard media events from the internal media element: abortaddtrackcanplaycanplaythroughchangecontentdatachangedurationchangeemptiedendedenterpictureinpictureerrorleavepictureinpictureloadeddataloadedmetadataloadstartpauseplayplayingprogressratechangeremovetrackresizeseekedseekingstalledsuspendtimeupdatevolumechangewaiting

Also emits these Video.js-specific events:

EventDescription
sourcechangeFired when `source` changes, either directly or by resolving a new `src`. Read `source` for the new value.

CSS custom properties

VariableDetails
--media-video-border-radius
--media-object-fit
--media-object-position
--media-caption-track-duration
--media-caption-track-delay
--media-caption-track-y