The <track> element is used to associate language subtitle tracks or text captioning tracks to the <audio> or <video> media elements. This is used to supply disabled people with text content to make your media more accessible, and to supply language subtitles for people who do not speak the language in the media.
<video controls="controls" width="600" height="400"> <source src="skydive.mp4" type="video/mp4"> <track kind=subtitles src=skydive_en.vtt srclang=en label="English"> <track kind=subtitles src=skydive_it.vtt srclang=it label="Italiano"> </video>The example above offers subtitles both in English and Italian for the video element. View the bottom of the page to see an example .vtt file.
Attributesglobals - the global attributes common to all elements possible values: see global attribute list default - enables the track by default Possible Values: value not required kind - the kind of text track Possible Values: "subtitles", "captions", "descriptions", "chapters", "metadata" label - The label the user sees for the track Possible Values: "string" src - path and file name for the track file Possible Values: "path/to/file" srclang - language of the track Possible Values: "place a valid language tag"
Track Tip: ".vtt" are WebVTT format which is intended for marking up external text track resources. You write the file and set time spanned cue points relating to times in the video playback you want the subtitles to appear. The skydive_en.vtt WebVTT file format looks like this:
00:05.000 --> 00:08.000 <v Adam Khoury>We are about to jump out of this plane everybody! 00:10.000 --> 00:13.000 <v Jesus Gomez>Yea this is going to be awesome dude man guy. 00:20.000 --> 00:27.000 <v Adam Khoury>OK you ready? 1... 2... 3... go go go... weeee!Continue setting cue point time spans and text values for the words spoken or singing performance in the video.