Skip to content
FrameworkStyle

dash-video

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

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

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 | NonNullable<Target["streamType"]>

Properties

PropertyTypeDefaultDetails
contentDataTarget["contentData"] | undefined
engineMediaPlayerClass
isFullscreenboolean
isPictureInPictureboolean
liveEdgeStartnumber
sourceDashSource | nullnull
srcstring''
streamTypeMediaStreamType | NonNullable<Target["streamType"]>
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