zenith-hls-adapter
v1.1.2
Published
Enterprise React Video Player
Maintainers
Readme
zenith-hls-adapter
HLS (.m3u8) playback adapter for zenith-player, powered by hls.js.
It plugs HLS support into Zenith Player as a lazy-loaded adapter, so hls.js is only downloaded when an HLS source actually plays.
Installation
npm install zenith-player zenith-hls-adapterzenith-player is a peer dependency (>=1.1.0).
Usage
Register the adapter directly:
import { ZenithPlayer } from "zenith-player";
const { createHlsAdapter } = await import("zenith-hls-adapter");
ZenithPlayer.use(createHlsAdapter({ emitHlsEvents: true, lowLatencyMode: true }));Or register it as a source-aware, lazy-loaded adapter so it only loads for .m3u8 sources:
ZenithPlayer.registerAdapter({
id: "hls",
matcher: (src) => /\.m3u8([?#].*)?$/i.test(src),
load: async () => (await import("zenith-hls-adapter")).createHlsAdapter(),
});Options
interface ZenithHlsAdapterOptions {
autoStartLoad?: boolean;
lowLatencyMode?: boolean;
liveSyncDurationCount?: number;
emitHlsEvents?: boolean;
sourceMatcher?: (src: string) => boolean;
}lowLatencyMode— enable hls.js low-latency mode for LL-HLS streams.emitHlsEvents— forward hls.js events through the player's analytics stream.sourceMatcher— customize which sources this adapter handles.
Features
- Adaptive bitrate (ABR) quality levels surfaced to the player's quality menu.
- Live and VOD playback, including LL-HLS.
- DRM via EME (Widevine / PlayReady) configured from the player's
drmconfig. - Quality switching without restarting playback (current time preserved).
License
MIT
Keywords
react · react-video-player · video-player · video · streaming · hls · hls.js · m3u8 · live-streaming · adaptive-bitrate · abr · zenith-player · adapter
