Advertisement

HTML <track> tag

Examples

Play video with subtitles:

<video width="320" height="240" controls="controls">
  <source src="forrest_gump.mp4" type="video/mp4" />
  <source src="forrest_gump.ogg" type="video/ogg" />
  <track kind="subtitles" src="subs_chi.srt" srclang="zh" label="Chinese">
  <track kind="subtitles" src="subs_eng.srt" srclang="en" label="English">
</video>

Browser Support

IE Firefox Chrome Safari Opera

Internet Explorer 10, Chrome and Opera support the <track> tag.

Definition and Usage

<Track> tag such as video media elements such provisions external text track.

Subtitles for specifying files or other files that contain text, when the media playback, these files are visible.

Browser Support

At present, all major browsers do not support the <track> tag.

HTML 4.01 and HTML 5 differences between

<Track> tag is new in HTML 5 tag.

Attributes

new: HTML5 new property.

Attributes value description
default default Provisions of the track is the default, if not select any track.
kind
  • captions
  • chapters
  • descriptions
  • metadata
  • subtitles
It shows a track belonging to what type of text.
label label Label or track title.
src url URL track.
srclang language_code Language tracks, if the kind attribute value is "subtitles", the property required.

Global Properties

<track> tag supports HTML in the global properties .

Event Properties

<track> tag supports HTML in the event properties .

Related Pages

HTML DOM Reference Manual: Track Objects