HTML track tag

The <track> tag is new in HTML5. Timed text track for media elements. The <track> tag represents external timed text tracks for media elements.

The media elements can be audio or video elements. The <track> tag specifies subtitles, caption files or other files containing text. The <track> tag is empty tag so no end tag required.

Syntax -
<track>.... </track>
AttributeDescriptionValues
srcSpecifies the location of text trackURL.
AttributeDescriptionValues
defaultSpecify automatically enables trackingDefault
kindSpecifies the text track kindsubtitles (default) captionsdescriptionschaptersmetadata
labelSpecifies the text track titleText.
srclangSpecifies the text track languageLanguage_code
Example -
<!DOCTYPE html>
<html>
<head>
	<title>Track tag example.. </title>
</head>
<body>
	<video width="360" height="240" controls>
	   <source src="video/light.mp4" type="video/mp4">
	   <track src="subtitles.vtt" kind="subtitles" label="English">
	</video>
</body>
</html>
Output -