The <track> tag marks text tracks for media elements <audio> and <video>.
<track> |
Yes | 10.0 | Yes | Yes | Yes |
The <track> tag is new in HTML5.
Attribute | Value | Description |
---|---|---|
default | default | Mark default track |
kind | captions chapters descriptions metadata subtitles |
Specifies the kind of text track |
label | text | Set the title of the text track |
src | URL | Required. Set the URL of the track file |
srclang | language_code | Set the language of the track text data (required if kind="subtitles") |
The <track> tag supports the Global Attributes in HTML.
The <track> tag supports the Event Attributes in HTML.
None.
<video width="320" height="240" controls> <source src="sound.mp4" type="video/mp4"> <source src="sound.ogg" type="video/ogg"> <track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English"> <track src="subtitles_ca.vtt" kind="subtitles" srclang="ca" label="Canadian"> </video>