References

Collection of references for web development.

HTML track tag

Description

The HTML <track> element represents tracks for the media elements <audio> and <video>.

Attributes

Attribute Value Description
default default Specifies the default track to be used if the user's preference is not appropriate.
kind captions
chapters
descriptions
metadata
subtitles
Specifies what kind the track is.
label string Specifies the label for the track.
src URL The URL of the file to embed in the document.
srclang language_code Specifies the language of the source.

Example

<video width="320" height="240" controls>
	<source src="anime.mp4" type="video/mp4">
	<source src="anime.ogg" type="video/ogg">
	<track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English">
	<track src="subtitles_jp.vtt" kind="subtitles" srclang="jp" label="Japanese">
</video>