Last Updated on April 26, 2023 by Roshan Parihar
Definition of HTML track tag
HTML track tag used to define text tracks(such as captions, subtitles etc) for video and audio.
There are five types of text tracks like subtitles, captions, descriptions, chapters, and metadata.
Table of Content
Syntax:
1 |
<track src="url of vtt extension file" kind="subtitles" srclang="en" label="English"> |
The track tag comes in the video and audio tag. The location and language of track can be defined using the different attributes of the track tags.
1 2 3 4 5 |
<video width="320" height="240" controls> <source src="../media/birdreaction.mp4" type="video/mp4" autoplay="true"> <track src="../media/subtitles_en.vtt" kind="subtitles" srclang="en" label="English"> Your Browser does not support the video element </video> |
Output
Element Specific Attribute
Sr. No. | attributes name | Description |
---|---|---|
1 | kind |
|
2 | src |
|
3 | default |
|
4 | label |
|
5 | srclang |
|
Resources and References
1. W3C Specification
2. HTML living standard
3. W3C project using Github