Can someone explain what the track element in HTML is for in very simple terms?
In the same way that a DVD can have multiple audio or video tracks, the <track>
element allows HTML5 video to do the same. This is primarily useful for things like adding subtitles.
As it says in the spec, they're for:
Although this part of the spec has been in a lot of flux in recent months and it isn't finalised yet, this presentation will give you some idea of the intended usage.
The track element lets you define subtitles, captions, descriptions, chapters, or metadata for either an audio or video element.
Sources:
The element allows authors to specify explicit external timed tracks for media elements. It does not represent anything on its own.
see here
Apologies for shameless self promotion, but I wrote an article about the track element for HTML5 Rocks: Getting Started With The Track Element.
EDIT: removed examples from post: as Jörn pointed out (see below) Chrome was crashing if you scrolled a video with a track element offscreen. This seems to have been fixed now (in 19.0.1053.0 canary) but I'll leave the examples out for the moment.
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.
Source.