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
import { DashVideo } from '@videojs/react/media/dash-video';
export default function BasicUsage() {
return <DashVideo className="dash-video" src="https://dash.akamaized.net/akamai/streamroot/050714/Spring_4Ktest.mpd" autoPlay muted playsInline loop />;
}
.dash-video {
width: 100%;
aspect-ratio: 16 / 9;
}
<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>
.media-container {
position: relative;
display: block;
width: 100%;
aspect-ratio: 16 / 9;
}
import '@videojs/html/media/container';
import '@videojs/html/media/dash-video';
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:
| Attribute | Type | Default | Details |
|---|---|---|---|
stream-type | MediaStreamType | NonNullable<Target["streamType"]> | — | |
| |||
Properties
| Property | Type | Default | Details |
|---|---|---|---|
config | MediaConfig | — | |
engine | MediaPlayerClass | — | |
| |||
isFullscreen | boolean | — | |
| |||
isPictureInPicture | boolean | — | |
| |||
liveEdgeStart | number | — | |
| |||
src | string | '' | |
streamType | MediaStreamType | NonNullable<Target["streamType"]> | — | |
| |||
targetLiveWindow | number | — | |
| |||
webkitCurrentPlaybackTargetIsWireless | boolean | undefined | — | |
| |||
webkitPresentationMode | WebKitPresentationMode | undefined | — | |
| |||
webkitSetPresentationMode | ((mode: WebKitPresentationMode) => void) | undefined | — | |
| |||
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: abortaddtrackcanplaycanplaythroughchangedurationchangeemptiedendedenterpictureinpictureerrorleavepictureinpictureloadeddataloadedmetadataloadstartpauseplayplayingprogressratechangeremovetrackresizeseekedseekingstalledsuspendtimeupdatevolumechangewaiting
This element emits no events beyond the standard media events above.
CSS custom properties
| Variable | Details |
|---|---|
--media-video-border-radius | |
| |
--media-object-fit | |
| |
--media-object-position | |
| |
--media-caption-track-duration | |
| |
--media-caption-track-delay | |
| |
--media-caption-track-y | |
| |