ReferencePresets
Audio preset
The audio-only preset — a player, feature bundle, skins, and media for on-demand audio
@videojs/html/audio is the preset for on-demand audio. It bundles the <audio-player> element, the audioFeatures bundle it is configured with, and two skins, and plays through the browser’s native <audio>. See Presets for how presets fit together and how to customize one.
Import
Import @videojs/html/audio/neutral-skin instead for the neutral skin. Or load one CDN bundle that registers the player and a skin together:
audio-neutral.js registers the neutral skin instead, and audio-player.js registers <audio-player> alone.
Usage
Player
@videojs/html/audio/player registers <audio-player>, whose class is AudioPlayerElement. It is a player element created by createPlayer with audioFeatures. 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 audio player’s store. Use it from any custom element inside <audio-player>; see PlayerController.
Feature bundle
audioFeatures is the array of features the player is configured with, a subset of the video preset’s videoFeatures:
Its type, AudioFeatures, 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
- AudioSkin — the default skin, with the modern, frosted look.
- NeutralAudioSkin — 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. Swap it for any compatible media component, such as <hls-audio> for HLS.
Exports
The preset root, @videojs/html/audio, has no side effects. Importing it never registers an element:
Registration entry points are side-effect-only: