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

HTML Reference Manual

HTML Tag Reference

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. Subtitle formats include WebVTT format (.vtt file format) — Web Video Text Tracks format, as well as Time-based Text Label Language (TTML) format.

The type of data added to media elements by 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 the browser makes available when the user requests additional data.
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 10and Chrome browsers support 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 HTML5and

<track> tag is a difference between HTML5 New tags 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 type of text in the text track.
labelHTML5textSpecifies the label 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 HTML Event Attributes.