Features

Captions

WebVTT caption tracks and HLS subtitle renditions.

Captions work on the native <video> path. YouTube and Dailymotion draw their own inside their iframe, where the player can't reach them. Vimeo draws its own too, but its caption tracks are listed in the player's captions menu, so picking one there switches Vimeo's. Brightcove and JW Player get real captions for free, since both resolve to an actual source, and the caption files they list beside the stream are added as tracks unless the player was given tracks of its own.

Remembering the viewer's choice

Turning captions off, or picking a language, is remembered across players and across reloads, the same way mute and volume are. The next video starts the way the viewer left the last one, instead of switching a <track default> or a manifest's default subtitle rendition back on every time.

The choice is stored as a language, never a track index, because index 0 is English on one source and Spanish on the next. Turning captions off travels everywhere. Turning them on travels only to a video that actually offers that language: where it doesn't, the source's own default stands rather than the viewer being given a language they never asked for. Until a viewer has expressed any preference at all, nothing is overridden.

WebVTT tracks

For sources without their own subtitle renditions - a plain MP4, say - supply WebVTT files via tracks. Each entry renders as a native <track>; the browser fetches and parses it, and default: true shows it immediately unless the viewer's stored choice says otherwise:

<VideoCard
  src="https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4"
  :tracks="[
    { src: '/captions/bbb-en.vtt', kind: 'captions', srclang: 'en', label: 'English', default: true },
    { src: '/captions/bbb-fr.vtt', kind: 'captions', srclang: 'fr', label: 'Français' },
  ]"
/>
<track> only understands WebVTT - convert SRT and other subtitle formats first.

HLS subtitle renditions

An HLS stream declaring subtitle renditions in its manifest is picked up automatically - by hls.js, or natively in Safari - with no tracks prop. A Captions option simply appears once the manifest parses:

<VideoCard src="https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_fmp4/master.m3u8" />

Loading player…

Apple's bipbop stream, no props beyond src. Open the controls - Captions appears on its own once the manifest parses.

Selecting a track

The Captions control cycles Off → first track → … → Off. Programmatically, setCaptionTrack(index) selects one and null turns captions off; every change fires captionchange once playback has started, including switches the streaming engine makes itself. Tracks are exposed as { index, label, language }.

Transcripts are a separate thing from captions, and work on every platform: see transcripts.

The same stream also exposes adaptive quality levels.

munsonlabs · MIT licensed · © 2026