WebVTT
In-game article clicks load inline without leaving the challenge.
WebVTT (Web Video Text Tracks) is a World Wide Web Consortium (W3C) standard for displaying timed text in connection with the HTML5 <track> element.
The early drafts of its specification were written by the WHATWG in 2010 after discussions about what caption format should be supported by HTML5—the main options being the relatively mature, XML-based Timed Text Markup Language (TTML) or an entirely new but more lightweight standard based on the widely used SubRip format. The final decision was for the new standard, initially called WebSRT (Web Subtitle Resource Tracks). It shared the .srt file extension and was broadly based on the SubRip format, though not fully compatible with it. The prospective format was later renamed WebVTT. In the January 13, 2011, version of the HTML5 Draft Report, the <track> element was introduced and the specification was updated to document WebVTT cue text rendering rules. The WebVTT specification is a W3C Candidate Recommendation, and the basic features are supported by all major browsers.
Main differences from SubRip
- WebVTT's first line starts with WEBVTT after the optional UTF-8 byte order mark
- There is space for optional header data between the first line and the first cue
- Timecode fractional values are separated by a full stop instead of a comma
- Timecode hours are optional
- The frame numbering/identification preceding the timecode is optional
- Comments identified by the word NOTE can be added
- Metadata information can be added in a JSON-style format
- Chapter information can be optionally specified
- Only supports extended characters as UTF-8
- CSS in a separate file defined in the companion HTML document for C tags is used instead of the FONT element
- Cue settings allow the customization of cue positioning on the video
Compatibility
| Browser | Cue Text Tags | Cue Positioning | CSS Styling |
|---|---|---|---|
| Chrome | 35+ | ||
| Android stock browser | 5.0+ | ||
| Opera | 22+ | ||
| Safari | 7+ (iOS: 8+) | ||
| Firefox | 31+ (Android: 32+) | —N/a | |
| Microsoft Edge | 12+ | —N/a | |
| Internet Explorer | 10+ | —N/a |
Firefox implemented WebVTT in its nightly builds (Firefox 24), but initially it was not enabled by default. The feature had to be enabled in Firefox by going to the "about:config" page and setting the value of "media.webvtt.enabled" to true. YouTube began supporting WebVTT in April, 2013. As of July 24, 2014, Mozilla has enabled WebVTT on Firefox by default.
Subtitles in a .vtt file show online, but not when stored on a local drive.
Example of WebVTT format
A sample file from the W3C captioning Roger Bingham interviewing Neil deGrasse Tyson ():
Other features
In June 2013, an example was added to the specification that included a new "region" setting. This feature is supported since Firefox 59 and Safari 14.1 (14.5 on iOS) but not in any other browser.