ReferencePresets
Live video preset
The live video preset — a player, feature bundle, skins, and media for live video streams
@videojs/react/live-video is the preset for live video streams. It bundles LiveVideoPlayer, the liveVideoFeatures bundle it is configured with, four skins that swap the time slider and time displays for a Live button, and the Video media component. See Presets for how presets fit together and Live streams for playing a live source.
Import
Each skin has its own stylesheet. Import @videojs/react/live-video/neutral-skin.css, compat-skin.css, or scaffold-skin.css instead when you use NeutralLiveVideoSkin, CompatLiveVideoSkin, or ScaffoldLiveVideoSkin.
Usage
Live streams are usually HLS, so this example plays through an HLS media component instead of the preset’s native video.
Player
LiveVideoPlayer is a Player created by createPlayer with liveVideoFeatures. It provides the player store to its descendants and renders no DOM element of its own.
LiveVideoPlayerProps types its props:
title and poster come from the metadata feature.
The preset also exports a usePlayer hook typed to liveVideoFeatures. Use it from any component inside LiveVideoPlayer; see usePlayer.
Feature bundle
liveVideoFeatures is the array of features the player is configured with. It is the video preset’s videoFeatures without playback rate, quality, and audio-track selection, plus the live feature:
Its type, LiveVideoFeatures, is the tuple of those features in order. Import it from the package root:
To add or remove a feature, pass your own array to createPlayer. The skins expect the features they render controls for.
Skins
- LiveVideoSkin — the default skin, which swaps the time controls for a Live button.
- NeutralLiveVideoSkin — the visually lighter variant, closer to a classic control bar.
- CompatLiveVideoSkin — the plain, unbranded variant that avoids newer visual effects, so it looks consistent across browsers.
- ScaffoldLiveVideoSkin — the minimally styled variant of Compat, a foundation for your own design.
See Choose a skin to compare them.
Media
The preset exports Video, the same component as the video preset, which renders a native <video>. Most browsers need a streaming media component to play a live source, such as HlsJsVideo for HLS.
Exports
@videojs/react/live-video exports:
Stylesheets: @videojs/react/live-video/skin.css, @videojs/react/live-video/neutral-skin.css, @videojs/react/live-video/compat-skin.css, and @videojs/react/live-video/scaffold-skin.css.