Skip to content
FrameworkStyle

Live

Live edge state for the player store

Exposes live-edge state so components can render a “jump to live” button, detect DVR vs. standard live, or hide live-only UI for on-demand sources.

liveEdgeStart is the presentation time at which the Live Edge Window begins — playback is “at the live edge” when currentTime >= liveEdgeStart. targetLiveWindow reports the seekable range size: 0 for standard latency live, Infinity for DVR, NaN for on-demand or unknown. Both values are NaN when the media doesn’t expose live-edge state (anything other than an HLS source today).

The live feature is included by the liveVideoFeatures and liveAudioFeatures presets; apps that build a custom preset can compose it in directly.

API Reference

State

Property Type Details
liveEdgeStart number
targetLiveWindow number

Selector

Pass selectLive to PlayerController to subscribe to live state. Returns undefined if the live feature is not configured.

import { createPlayer, MediaElement, selectLive } from '@videojs/html';
import { liveVideoFeatures } from '@videojs/html/live-video';

const { PlayerController, context } = createPlayer({ features: liveVideoFeatures });

class LiveEdgeButton extends MediaElement {
  readonly #live = new PlayerController(this, context, selectLive);
}