The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.


Jump to: navigation, search


This article is Ready to Use.

W3C Editor's Draft


A media element can have a group of associated text tracks, known as the media element's "list of text tracks".


API Name Summary
activeCues Returns the text track cues from the text track list of cues that are currently active (i.e. that start before the current playback position and end after it), as a TextTrackCueList object.
kind Returns the text track kind string.
label Returns the text track label, if there is one, or the empty string otherwise (indicating that a custom label probably needs to be generated from the other attributes of the object if the object is exposed to the user).
language Returns the text track language string.


API Name Summary
removeCue Removes the given cue from textTrack's text track list of cues.


No events.


The track object contains the collection of TextTrackCues (times and text) that are contained in the file that the track element represents.


TextTrackCues within a TextTrack can be defined within a WebVTT file which is defined as an 8-bit Unicode Transformation Format (UTF-8) format text files that look like the following.


00:00:01.878 --> 00:00:05.334
Good day everyone, my name is John Smith

00:00:08.608 --> 00:00:15.296
This video will teach you how to 
build a sand castle on any beach

The file starts with the tag "WEBVTT" as the first line, followed by a line feed. The timing cues are in the format "HH:MM:SS.sss". The start and end time cues are separated by a space, two hyphens and a greater-than sign ( --> ), and another space. The timing cues are on a line by themselves followed by a line feed. Immediately following the cue is the caption text. Text captions can be one or more lines. The only restriction is that there must be no blank lines between lines of text. The MIME type is "text/vtt".

Related specifications

Specification Status Related Changes
W3C HTML5 Specification W3C Editor's Draft