Skip to content

ReferenceMedia

dash-video

Unstable

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/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-rc.4/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—
sourceobjectnull
srcstring''
streamTypeMediaStreamType—
targetLiveWindownumber—
webkitCurrentPlaybackTargetIsWirelessboolean | undefined—
webkitPresentationModeWebKitPresentationMode | undefined—
webkitSetPresentationModeundefined | function—

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

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

VariableDescription
--media-video-border-radiusBorder radius of the video element.
--media-object-fitObject fit for the video.
--media-object-positionObject position for the video.
--media-caption-track-durationDuration of the caption track transition.
--media-caption-track-delayDelay before the caption track transition.
--media-caption-track-yVertical offset of the caption track.