HTML Tutorial
Usage:
The <track>
tag provides closed captions or subtitles for media content, such as videos and audios. It allows users to view text annotations that correspond to the audio or video being played.
Attributes:
Examples:
<video controls>
<source src="video.mp4" type="video/mp4">
<track kind="subtitles" src="subtitles.vtt" label="English Subtitles">
</video>
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
<track kind="captions" src="captions.vtt" label="English Captions">
</audio>
Exploring the <track>
tag:
<video>
or <audio>
element.<source>
element that specifies the URL of the media file.<video>
or <audio>
element, add a <track>
element.kind
attribute to "subtitles" or "captions".src
attribute.label
attribute to a human-readable label for the text track.