English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete list of HTML tags

HTML: <track> tag

The HTML <track> element is used as a child element of media elements - <audio> and <video>. It allows specifying timed text subtitles (or time-based data), such as automatic subtitle processing. The subtitle formats include WebVTT format (.vtt file format) - Web Video Text Tracks format, as well as Time Text Label Language (TTML) format.

The type of data added to the media element by the track is set in the kind attribute, which can be subtitles, captions, descriptions, chapters, or metadata. This element points to a source file containing timed text that is made available by the browser when the user requests additional data. The subtitle formats include WebVTT format (.vtt file format) - Web Video Text Tracks format, as well as Time Text Label Language (TTML) format.
Two track child elements of any media element cannot have the same kind, srclang, and label attributes.

Online example

A video with two subtitle tracks:

<video width="320" height="240" controls>
  <source src="track.mp4" type="video/mp4">
  <source src="track.ogg" type="video/ogg">
  <track src="track_en.vtt" kind="track" srclang="en" label="English">
  <track src="track_no.vtt" kind="track" srclang="no" label="Norwegian">
</video>

Browser compatibility

IEFirefoxOperaChromeSafari

IE 10Supports the <track> tag.

Definition and usage of the tag

The <track> tag specifies external text tracks for media elements (such as <audio> and <video>).

This element is used to specify subtitle files or other text-containing files that are visible when the media is played.

HTML 4.01 and HTML5difference between

<track> tag is HTML5 New tag in

Optional attributes

New: HTML5 New attribute in

AttributeValueDescription
defaultHTML5defaultSpecifies that the track is the default. If the user does not select any track, the default track is used.
kindHTML5captions
chapters
descriptions
metadata
subtitles
Specifies the text type of the text track.
labelHTML5textSpecifies the tag and title of the text track.
srcHTML5URLRequired. Specifies the URL of the track file.
srclangHTML5language_codeSpecifies the language of the track text data. If the value of the kind attribute is "subtitles", this attribute is required.

Global attributes

Support for <track> tag Global attributes of HTML.

Event attributes

Support for <track> tag Event attributes of HTML.