<track>
HTML <track> Tags
Example
Video with two subtitle tracks:
<video width="320" height="240" controls>
<source src="//m.sbmmt.com/m/tags/forrest_gump.mp4" type="video/mp4">
<source src="//m.sbmmt.com/m/tags/forrest_gump.ogg" type="video/ogg">
<track src="//m.sbmmt.com/m/tags/subtitles_en.vtt" kind="subtitles" srclang="en"
label="English">
<track src="//m.sbmmt.com/m/tags/subtitles_no.vtt" kind="subtitles" srclang="no"
label="Norwegian">
</video>
<source src="//m.sbmmt.com/m/tags/forrest_gump.mp4" type="video/mp4">
<source src="//m.sbmmt.com/m/tags/forrest_gump.ogg" type="video/ogg">
<track src="//m.sbmmt.com/m/tags/subtitles_en.vtt" kind="subtitles" srclang="en"
label="English">
<track src="//m.sbmmt.com/m/tags/subtitles_no.vtt" kind="subtitles" srclang="no"
label="Norwegian">
</video>
Browser support
IE 10, Opera and Chrome browsers support the <track> tag.
Tag definition and usage instructions
The<track> tag specifies an external text track for media elements (such as <audio> and <video>).
This element is used to specify subtitle files or other files containing text that are visible when the media is played.
Differences between HTML 4.01 and HTML5
The<track> tag is a new tag in HTML5.
Optional attributes
New: New attributes in HTML5.
Attribute | Value | Description |
---|---|---|
default | defaultSpecifies that this track is the default. If the user does not select any track, the default track is used. | |
New | captions
chapters descriptions metadata subtitles | Specifies the text type of the text track. |
. | src . Specifies the URL of the track file. | srclang |
language_code | Specifies the language of the track text data. This attribute is required if the kind attribute value is "subtitles". | |
The<track> tag supports HTML global attributes. | Event attributes<track> tag supports HTML event attributes. |