HTML Dog
Skip to navigation

HTML Tag: track

Timed text track, to accompany video or audio resources. This could take the form of subtitles, closed captions, descriptions, chapter titles, or other metadata.

track has no content and therefore does not warrant a closing tag.

Required Attributes

Attribute Description Possible values
src The location of the text track to be used. Typically a WebVTT file. URL.

Optional Attributes

Attribute Description Possible values
kind How the text track should be interpreted.
  • subtitles (default): Transcription or translation of dialogue. Commonly used as a foreign-language track.
  • captions: Transcription or translation of any sound. Suitable as a hard-of-hearing track.
  • descriptions: Textual description of video, intended to be turned into synthesized audio. Suitable as a track for visually-impaired users.
  • chapters: Chapter titles, enabling navigation of the media resource.
  • metadata: Any additional data to be utilized, in any chosen fashion, by JavaScript.
srclang Language of the text track. Language tag, such as en (English) or fr (French).
label User-accessible title for the text track. Text.
default Automatically enables the track if no user-preference suggests an alternative. None.
Global attributes

Example


<audio src="mrMurray_downCameTheRain.mp3" controls>
    <track src="dctr_en.vtt" srclang="en" default>
    <track src="dctr_fr.vtt" srclang="de">
    <track kind="metadata" src="dctr_wtf.vtt">
</audio>