HTML <track> defaultProperty

HTML <track> tag

Example

Below is a video element, in which one of the two subtitles is the default:

<video width="320" height="240" controls>
  <source src="forrest_gump.mp4.html" type="video/mp4">
  <source src="forrest_gump.ogg.html" type="video/ogg">
  <track src="subtitles_en.vtt.html" kind="subtitles" srclang="en"
  label="English" default>
  <track src="subtitles_no.vtt.html" kind="subtitles" srclang="no"
  label="Norwegian">
</video>

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 10, Opera, and Chrome support the default attribute.


Definition and Usage

The default attribute is a boolean attribute.

If the default attribute is used, it specifies that this track should be used, in case the user has not selected another track.


Differences between HTML 4.01 and HTML5

The <track> tag is new in HTML5.


Differences between HTML and XHTML

In XHTML, attribute minimization is not allowed, and the default attribute must be defined as: <track default="default" />.


Syntax

<track src="subtitles_en.vtt.html" default>


HTML <track> tagother extensions