asp.net.ph

Skip Navigation LinksHome > Abakada: Back to Basics > Language References > HTML Elements > TRACK Element

<track> Element


Defines text tracks for media elements.HTML 5

HTML Syntax

Only the <track> start tag must be present. The element has no end tag.

Remarks

The <track> element is used to specify supplementary text tracks for <audio> and <video> elements.

The src attribute is required and gives the URL of the text track data. The value must be a valid non-empty URL.

The kind attribute is an enumerated attribute with the following keywords and description:
KeywordDescription
subtitlesTranscription 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 audio track). Overlaid on the video.
captionsTranscription or translation of the dialogue, sound effects, relevant musical cues, and other relevant audio information, suitable for when sound is unavailable or not clearly audible (e.g. because it is muted, drowned-out by ambient noise, or because the user is deaf). Overlaid on the video; labeled as appropriate for the hard-of-hearing.
descriptionsTextual descriptions of the video component of the media resource, intended for audio synthesis when the visual component is obscured, unavailable, or not usable (e.g. because the user is interacting with the application without a screen while driving, or because the user is blind). Synthesized as audio.
chaptersTracks intended for use from script. Not displayed by the user agent.
metadata

Attributes

The <track> element supports the following attributes, in addition to global attributes common to all HTML elements.

AttributeValueDescription
default Specifies that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate
kindcaptions, chapters, descriptions, metadata, subtitlesSpecifies the kind of text track
labeltextSpecifies the title of the text track
srcURLRequired. Specifies the URL of the track file
srclanglanguage_codeSpecifies the language of the track text data (required if kind="subtitles")

Example

The following is a basic example of using the <track> element.

<video src="brave.webm">
   <track kind=subtitles src=brave.en.vtt srclang=en label="English">
   <track kind=subtitles src=brave.fr.vtt srclang=fr lang=fr label="Français">
   <track kind=subtitles src=brave.de.vtt srclang=de lang=de label="Deutsch">
   <track kind=captions src=brave.en.hoh.vtt srclang=en label="English for the Hard of Hearing">
</video>

External References

See Also

AUDIO   VIDEO



Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note