track
-
Each
track
element lets you specify a timed text track (or time-based data) that can be displayed in parallel with the media element, for example to overlay subtitles or closed captions on top of a video or alongside audio tracks -
The
track
element is used as a child of the media elements,audio
andvideo
-
Multiple
track
elements can be specified for a media element, containing different kinds of timed text data -
The data that is used will either be the
track
that has been set to be the default, or akind
and translation based on user preferences -
The
track
element does not represent anything on its own
-
Each
kind
-
The
kind
attribute is an enumerated attribute (takes one of a finite set of keywords) - The following table lists the keywords defined for this attribute
keyword
/statedescription subtitles
/subtitles- Transcription or translation of the dialogue, suitable for when the sound is available but not understood (e.g. because the user does not understand the language of the media resource's soundtrack)
- Displayed over the video
captions
/Captions- Transcription or translation of the dialogue, sound effects, relevant musical cues, and other relevant audio information, suitable for when the soundtrack is unavailable (e.g. because it is muted or because the user is deaf)
- Displayed over the video; labeled as appropriate for the hard-of-hearing
descriptions
/Descriptions- Textual descriptions of the video component of the media resource, intended for audio synthesis when the visual component is unavailable (e.g. because the user is interacting with the application without a screen while driving, or because the user is blind
- Synthesized as separate audio track.
chapters
/Chapters- Chapter titles, intended to be used for navigating the media resource
- Displayed as an interactive list in the user agent's interface
metadata
/Metadata- Tracks intended for use from script
- Not displayed by the user agent
-
The
kind
attribute may be omitted -
The missing value default is the
subtitles
state
-
The
src
-
The
src
attribute gives the address of the text track data - The value must be a valid non-empty URL potentially surrounded by spaces
- This attribute must be present
-
The
-
srclang
-
The
srcang
attribute gives the language of the text track data - The value must be a valid BCP 47 language tag
-
This attribute must be present if the element's
kind
attribute is in thesubtitles
state
-
The
-
label
-
The
label
attribute gives a user-readabletitle
for the track -
This
title
is used by user agents when listingsubtitle
,caption
, andaudio
description tracks in their user interface -
If the element has a
label
attribute whose value is not the empty string, then the element's track label is the value of the attribute -
Otherwise, the element's track
label
is a user-agent defined string (e.g. the string "untitled")
-
The
-
default
-
The
default
attribute, if specified, indicates that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate -
There must not be more than one track element with the same parent node with the
default
attribute specified
-
The