HTML track tag


Definition of HTML track tag

HTML track tag used to define text tracks(such as captions, subtitles etc) for video and audio.


There are five types of text tracks like subtitles, captions, descriptions, chapters, and metadata.



Syntax:

The track tag comes in the video and audio tag. The location and language of track can be defined using the different attributes of the track tags.

Output



Element Specific Attribute

Sr. No. attributes name Description
1 kind
  • Used to specify the kind of text tracks.
  • The values for this attribute are
    • captions
    • chapters
    • descriptions
    • metadata
    • subtitles
2 src
  • Used to specify the URL location of the vtt file.
  • The value for this is the URL of the media resource vtt extension file.
3 default
  • Used to Specify that the track should be enabled unless the user’s preferences indicate that another track is more appropriate and important.
  • The value for this attribute is default
4 label
  • Used to Specify the title of the text track.
  • The value for this is the title of the track.
5 srclang
  • Used to Specify language of the text track. The attribute is required if the kind of the text track if ‘subtitle’.
  • The value for this is the language of the track.

Resources and References

1. W3C Specification
2. HTML living standard
3. W3C project using Github