Module track

Module track 

Source
Expand description

Attribute names for track (<track>) elements.

§Purpose

The <track> element provides timed text tracks (like subtitles, captions, or chapters) for <audio> and <video> elements, improving accessibility and user experience.

§Common Attributes

  • src: URL of the track file (WebVTT format)
  • kind: Type of track (subtitles, captions, descriptions, chapters, metadata)
  • srclang: Language of the track text
  • label: User-visible label for the track
  • default: Marks this track as default

§Example

<video src="movie.mp4" controls>
  <track kind="subtitles" src="en.vtt" srclang="en" label="English" default>
  <track kind="subtitles" src="es.vtt" srclang="es" label="Español">
  <track kind="captions" src="en-cc.vtt" srclang="en" label="English CC">
  <track kind="chapters" src="chapters.vtt" srclang="en">
</video>

§WHATWG Specification

Constants§

DEFAULT
The default attribute.
KIND
The kind attribute.
LABEL
The label attribute.
SRC
The src attribute.
SRCLANG
The srclang attribute.