English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <track> default attribute

The default attribute of <track> is a boolean attribute. The default attribute specifies that if the user's preference does not indicate another track is more suitable, then this track will be enabled. Note: The default attribute of each media element may not exceed one track element.

 HTML <track> tag

Online Example

A video with two subtitle tracks. The "English" subtitle is used by default:

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

Browser Compatibility

IEFirefoxOperaChromeSafari

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

Definition and Usage

The default attribute is a boolean attribute.
The default attribute specifies that the track will be enabled if the user's preferences do not indicate that another track is more suitable.
Note: The default attribute of each media element must not exceed one track element.

HTML 4.01 versus HTML5differences

<track> tag is in HTML5 New tags.

Differences between HTML and XHTML

In XHTML, attributes cannot be abbreviated, the default attribute must be defined as: <track default="default" />.

Syntax

    <track src="subtitles_en.vtt" default>


 HTML <track> tag