HTML and track and default properties

HTML track default attribute HTML

The default property defines the track that is used by default in the video element, and if you have a better track selection, set the default property for it, which can be owned by only one track element in each media element.

Here's a video element, one of which has one of the two subtitles that is default:

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

Browser support

HTML track default attribute HTML track default attribute HTML track default attribute HTML track default attribute HTML track default attribute

Internet Explorer 10, Opera, and Chrome support default properties.


Definitions and usages

The default property is a boolean property.

If you use the default property, you specify that the track should be used if the user does not select a different track.


The difference between HTML 4.01 and HTML5

The label is a new HTML5 label.


The difference between HTML and XHTML

In XHTML, the property does not allow an introduction, and the default property must be defined as: slt;track default."


Grammar

<track src="subtitles_en.vtt" default>

HTML track default attribute HTML