ReferencePresets
Live video preset
The live video preset — a player, feature bundle, skins, and media for live video streams
@videojs/html/live-video is the preset for live video streams. It bundles the <live-video-player> element, the liveVideoFeatures bundle it is configured with, and two skins that swap the time slider and time displays for a Live button, and plays through the browser’s native <video>. See Presets for how presets fit together and Live streams for playing a live source.
Import
Import @videojs/html/live-video/neutral-skin instead for the neutral skin. Or load one CDN bundle that registers the player and a skin together:
live-video-neutral.js registers the neutral skin instead, and live-video-player.js registers <live-video-player> alone.
Usage
Live streams are usually HLS, so this example plays through an HLS media component instead of the preset’s native video.
Player
@videojs/html/live-video/player registers <live-video-player>, whose class is LiveVideoPlayerElement. It is a player element created by createPlayer with liveVideoFeatures. It owns the player store but no layout. Put a skin or a <media-container> inside it.
content-title and poster come from the metadata feature. The element’s read-only store property returns its player store.
The preset root also exports a PlayerController bound to the live video player’s store. Use it from any custom element inside <live-video-player>; see PlayerController.
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 plays through a native <video>, so it registers no media component of its own. Most browsers need a streaming media component to play a live source, such as <hlsjs-video> for HLS.
Exports
The preset root, @videojs/html/live-video, has no side effects. Importing it never registers an element:
Registration entry points are side-effect-only: