track-
Each
trackelement 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
trackelement is used as a child of the media elements,audioandvideo -
Multiple
trackelements can be specified for a media element, containing different kinds of timed text data -
The data that is used will either be the
trackthat has been set to be the default, or akindand translation based on user preferences -
The
trackelement does not represent anything on its own
-
Each
kind-
The
kindattribute 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
kindattribute may be omitted -
The missing value default is the
subtitlesstate
-
The
src-
The
srcattribute 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
srcangattribute 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
kindattribute is in thesubtitlesstate
-
The
-
label-
The
labelattribute gives a user-readabletitlefor the track -
This
titleis used by user agents when listingsubtitle,caption, andaudiodescription tracks in their user interface -
If the element has a
labelattribute whose value is not the empty string, then the element's track label is the value of the attribute -
Otherwise, the element's track
labelis a user-agent defined string (e.g. the string "untitled")
-
The
-
default-
The
defaultattribute, 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
defaultattribute specified
-
The