HTML: The Markup Language Reference

tracksupplementary media track NEW # T

The track element enables supplementary media tracks such as subtitle tracks and caption tracks to be specified for audio and video elements.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
kind = "subtitles" or "captions" or "descriptions" or "chapters" or "metadata" #
The kind of timed track.
  • "subtitles": Transcription or translation of the dialogue in the soundtrack of the video or audio stream; meant for users who have access to the soundtrack but for whom it is not fully usable as intended (for example, for users who do not understand the language of the soundtrack).
  • "captions": Transcription or translation of the dialogue, sound effects, relevant musical cues, and other relevant aural information in the video or audio stream; intended for cases where users do not have any access at all to the soundtrack (for example, for users who are deaf or for the case when the soundtrack is currently muted).
  • "descriptions": Textual descriptions of the visual component of a video; meant for use with audio synthesis when the visual component is unavailable (for example, for users who are blind, or for users who are currently unable to view the screen on which the video is displayed—for example, a user accessing the video while driving a car).
  • "chapters": Chapter titles.
  • "metadata": Metadata content meant for use from script.
src = Non-empty URL potentially surrounded by spaces #
The address of the timed track.
srclang = language tag #
The language of the timed track.
A valid language tag as defined in [BCP 47].
label = string #
A user-readable title for the timed track.
default = "default" or "" (empty string) or empty #
Instructs the UA that the track is to be enabled if the user’s preferences do not indicate that another track would be more appropriate.

Additional constraints and admonitions #

Tag omission #

A track element must have both a start tag and an end tag.

Permitted parent elements #

audio, video

DOM interface #

interface HTMLTrackElement : HTMLElement {
           attribute DOMString kind;
           attribute DOMString src;
           attribute DOMString srclang;
           attribute DOMString label;
           attribute boolean default;

  readonly attribute TextTrack track;