The HTML <track> tag is used to specify text tracks for <video> and <audio> elements. These tracks are usually subtitles, captions, or other kinds of time-based data that are associated with media content.
HTML track tag Syntax
<track src="url" kind=".." srclang="language" label=" ">
Html <track> tag Attributes:
Default: The track is the default one to be used if no other track is selected.
kind: The kind of text track.
label: Provides a user read title for the track.
src: Specifies the URL of the track file.
srclang: Specifies the language of the track text data.
HTML track tag With example
<video controls> <source src="video.mp4" type="video/mp4"> <track kind="Titles" src="subtitles_en.vtt" srclang="en" label="English"> <track kind="Captions" src="captions_en.vtt" srclang="en" label="Indian_English"> Your browser does not support the video tag. </video>
HTML track tag .vtt file ( Web VTT format)
WEB VTT format 00:00:00.000 --> 00:00:05.000 This is the first title. 00:00:05.000 --> 00:00:10.000 This is the second sub title.