<video> to HLS or DASH is a one-line change — your skin and features stay the same.
Plain video and audio
- React
- HTML
HLS
The HLS media element wraps hls.js and is included in@videojs/core as a dependency. Pass an .m3u8 URL directly as src:
- React
- HTML
DASH
The DASH media element wraps dash.js and is also bundled in@videojs/core. Pass an .mpd URL as src:
- React
- HTML
Background video
The/background preset bakes in autoplay, muted, and loop on the media element — ideal for hero sections and decorative video:
- React
- HTML
Swapping sources dynamically
Media components accept asrc prop that you can update at any time. The player reacts to src changes automatically:
- React
- HTML
Error handling
When media fails to load, the player exposes error state. The built-in skins render a dismissable error dialog automatically. To handle errors in custom skins:- React
- HTML
Media element reference
| Component (React) | Element (HTML) | Source format |
|---|---|---|
Video | <video> | MP4, WebM, and other browser-native formats |
Audio | <audio> | MP3, AAC, Ogg, and other browser-native formats |
HlsVideo | <hls-video> | HLS (.m3u8) via hls.js |
DashVideo | <dash-video> | MPEG-DASH (.mpd) via dash.js |
BackgroundVideo | <background-video> | MP4 (autoplay, muted, loop) |
Next steps
Custom features
Control which features and state the player tracks.
Custom skins
Build a skin that matches your design.