ReferencePresets
Live audio preset
The live audio preset — a player, feature bundle, skins, and media for live audio streams
@videojs/html/live-audio is the preset for live audio streams. It bundles the <live-audio-player> element, the liveAudioFeatures 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 <audio>. See Presets for how presets fit together and Live streams for playing a live source.
Import
Import @videojs/html/live-audio/neutral-skin instead for the neutral skin. Or load one CDN bundle that registers the player and a skin together:
live-audio-neutral.js registers the neutral skin instead, and live-audio-player.js registers <live-audio-player> alone.
Usage
Live streams are usually HLS, so this example plays through an HLS media component instead of the preset’s native audio.
Player
@videojs/html/live-audio/player registers <live-audio-player>, whose class is LiveAudioPlayerElement. It is a player element created by createPlayer with liveAudioFeatures. 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 audio player’s store. Use it from any custom element inside <live-audio-player>; see PlayerController.
Feature bundle
liveAudioFeatures is the array of features the player is configured with. It is the audio preset’s audioFeatures without playback rate, plus the live feature:
Its type, LiveAudioFeatures, 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
- LiveAudioSkin — the default skin, which swaps the time controls for a Live button.
- NeutralLiveAudioSkin — the visually lighter variant, closer to a classic control bar.
Media
The preset plays through a native <audio>, so it registers no media component of its own. Most browsers need a streaming media component to play a live source, such as <hls-audio> for HLS.
Exports
The preset root, @videojs/html/live-audio, has no side effects. Importing it never registers an element:
Registration entry points are side-effect-only: