Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <track> default Attribute

The default attribute on a <track> tag sets that track as default.

The audio or video player uses that track if no other preferences are specified.

Example

#

A default attribute on a <track> element.
The video has 2 subtitle tracks with the first one as default.

<video controls="controls" width="320" height="176">
  <source src="/media/godfather.mp4" type="video/mp4" />
  <source src="/media/godfather.ogg" type="video/ogg" />
  <track src="/media/godfather-en.srt" kind="subtitles" srclang="en" label="English" default />
  <track src="/media/godfather-es.srt" kind="subtitles" srclang="es" label="Spanish" />
</video>

Using default

The default attribute identifies the track as default.

This default track is used if no other track preference are specified.

For each media player, only one track can be the default.


Syntax

<track src="URL" default>

Browser support

Here is when default support started for each browser:

Chrome
23.0 Nov 2012
Firefox
31.0 Jul 2014
IE/Edge
10.0 Sep 2012
Opera
12.1 Nov 2012
Safari
6.0 Jul 2012

You may also like

 Back to <track>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides