HLS Media

Adaptive HLS video and audio elements that play a manifest through the same shells as a progressive file, filling the quality menu from the renditions the stream declares.

UIhls-mediaView JSON

The adaptive elements play an HLS manifest through the shells you already composed: the player and the skin do not change, the quality menu fills itself from the renditions the manifest declares, and captions stay plain `tracks` data. Video.js 10 ships the stream engine, so HLS plays over Media Source Extensions without another dependency, and the engine resolves the segment URIs relative to the manifest it was given. `streamType` defaults to the detected value; pin it when you know the delivery up front, for example `streamType="live"` inside the live shell. The demos play the committed fixtures generated by `scripts/generate-media-samples.sh`.

Preview

Adaptive stream
0:00
0:00

Installation

Add the item with the shadcn CLI, or copy the source manually.

pnpm dlx shadcn@latest add litingyes/blocove/hls-media

Requires a shadcn/ui project set up with Base UI primitives. Blocove is developed against the b0 preset, but it installs no base config or theme tokens: your own preset, fonts and colors stay in place.

Or install from the namespace after adding the registry: npx shadcn@latest add @blocove/hls-media

This example also uses: video-playeraudio-player

pnpm dlx shadcn@latest add litingyes/blocove/video-player litingyes/blocove/audio-player

API Reference

Props accepted by the exported components.

HlsVideoMedia

The adaptive `<video>` element. It registers itself as the player's media on mount like the progressive element does, so the same shells play a manifest: the skin, the controls and the settings menu do not change, and the quality menu fills itself from the renditions the manifest declares.

PropTypeDefault
srcstring-
sourceHlsVideoSource | nullnull
preload'none' | 'metadata' | 'auto''metadata'
crossOrigin'anonymous' | 'use-credentials' | '' | nullnull
disableRemotePlaybackbooleanfalse
streamType'on-demand' | 'live' | 'unknown''unknown'
playsInlinebooleantrue
tracksMediaTrack[]-
...propsVideoHTMLAttributes<HTMLVideoElement>-

HlsAudioMedia

The adaptive `<audio>` element. It plays the audio rendition of a manifest through the same audio shell as a progressive file, so an episode can move from a download to a playlist without touching the interface.

PropTypeDefault
srcstring-
source{ src?: string, type?: string, drm?: DrmSystemsConfig } | nullnull
preload'none' | 'metadata' | 'auto''metadata'
crossOrigin'anonymous' | 'use-credentials' | '' | nullnull
disableRemotePlaybackbooleanfalse
tracksMediaTrack[]-
...propsAudioHTMLAttributes<HTMLAudioElement>-