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, two 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 instead when you use NeutralLiveVideoSkin.
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.
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 and @videojs/react/live-video/neutral-skin.css.