coderef

WebVTTBaseline · Widely available

WebVTT is a captions and subtitles format. WebVTT files are loaded using the <track> element, and the VTTCue API can be used to create or update cues dynamically.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 29, 2015. Widely available since Jan 29, 2018.

Browser support

DesktopChrome
1–22Not supported
23+Supportedsince Nov 6, 2012
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1–30Not supported
31+Supportedsince Jul 22, 2014
Current: 157
Safari
1–5.1Not supported
6+Supportedsince Jul 25, 2012
Current: 27
MobileChrome Android
18–18Not supported
25+Supportedsince Feb 27, 2013
Current: 155
Firefox Android
4–30Not supported
31+Supportedsince Jul 22, 2014
Current: 157
Safari iOS
1–7Not supported
8+Supportedsince Sep 17, 2014
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: VTTCue.

Feature detection

JS · check before using
if ("VTTCue" in globalThis) {
  // VTTCue is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (7). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
VTTCue231231625318
VTTCue.VTTCue337931833318
VTTCue.getCueAsHTML231231625318
VTTCue.text231231625318
VTTCue.text.all_html_character_references637912717.56312717.5
cue267955726557
cue.selector_argument2679✕726✕7