Skip to content
FrameworkStyle

DashVideo

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/react @videojs/dash-video
import { DashVideo } from '@videojs/react/media/dash-video';

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 />;
}

API Reference

Props

Accepts the standard React props for a native <video>, plus these Video.js-specific props:

PropTypeDefaultDetails
source{ src?: string; engine?: DashEngineConfig } | nullnull
srcstring''

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.

<DashVideo
  source={{
    src: 'https://example.com/manifest.mpd',
    engine: { dashJs: { streaming: { buffer: { fastSwitchEnabled: true } } } },
  }}
/>
OptionTypeDetails
debugobject
errorsobject
streamingobject

Ref

Forwards its ref to the rendered <video>. The ref is an HTMLVideoElement and exposes its complete native property and method API.

Events

Handle standard media events with React event props such as onPlay and onTimeUpdate. For native events without a React prop, attach a listener through the ref with addEventListener.