With reference of previous chapter you may have familiar with the TIME Element. Now in this chapter we will learn about the TRACK Element, which is still not supported by any of the browsers.
The TRACK Element is used to define subtitles, captions, descriptions, chapters, or metadata for either an audio or video element. The TRACK Element is still not supported by any of the browsers. The TRACK Element is used to specify subtitles, caption files or other files containing text, that is visible when the media file is played.
The TRACK Element is followed by the following attributes and values: default (specifies that track is enabled), kind (specify the kind of track), label (specify the title of the text track), src (specify the url of track file) and srclang (specify the language track text)
Here is the Syntax for TRACK Element
<time src="" kind="" srclang="" label="" default>
Below is complete syntax along with example
<!DOCTYPE html> <html> <head> <title>Title name will go here</title> </head> <body> <video width="500" height="375" controls="controls"> <source src="media/sample_video.mp4" type="video/mp4" /> <source src="your ogg media file name" type="video/ogg" /> <track src="media/subtitles_en.vtt" kind="subtitles" srclang="en" label="English"> <track src="media/subtitles_hi.vtt" kind="subtitles" srclang="hi" label="Hindi"> Your browser does not support the video tag. </video> </body> </html>