Multi-language captions

accessibility

WebVTT captions in two languages with a captions menu and styled cues.

Caption track
Caption size

Captions render in an overlay the skin controls, so they move above the control bar and follow your design tokens. Press C to toggle them from the keyboard.

Big Buck Bunny © Blender Foundation, CC BY 3.0, via Wikimedia Commons. HLS test stream by Mux, DASH by Akamai.

The code

tsx
createPlayer('#player', {
src: 'movie.mp4',
tracks: [
{ src: '/captions.en.vtt', label: 'English', srclang: 'en', default: true },
{ src: '/captions.es.vtt', label: 'Español', srclang: 'es' },
],
tokens: { 'cue-size': '1.25' }, // scale caption text
skin: minimal(),
});
​
player.setTextTrack(1); // show Spanish, -1 turns captions off