Export (0) Print
Expand All

default attribute | default property

Gets or sets the default timed text track to use when multiple track elements are specified for a video element.

This property is read/write.

HTML5 A vocabulary and associated APIs for HTML and XHTMLInternet Explorer 10

 

Syntax

HTML
<element default="default" ... >

 

JavaScript
object.default = default
default = object.default

 

Property values

Type: boolean

Standards information

Remarks

This property defines whether the TextTrack is the default for a given video element. The presence of the default attribute, regardless of assigned value, in the track element equals true.

If no default is specified, no text track will be displayed with the video. Any track can be selected using the default attribute. If more than one track has the default attribute, the first track with the attribute will be default, and the others will be ignored.

Note  To create timed text files in both Web Video Text Track (WebVTT) and Timed Text Markup Language (TTML) formats, see HTML5 Video Caption Maker on the Windows Internet Explorer test drive site.

Examples

The following example shows a video element with three text tracks. The English track is the default.


<video id="video1" controls>
<source src="video.mp4">
  <!-- The English text track is used by default -->
  <track id="entrack" label="English subtitles" kind="captions" src="entrack.vtt" srclang="en" default>
  <track id="sptrack" label="Spanish subtitles" kind="captions" src="estrack.vtt" srclang="es">
  <track id="detrack" label="German subtitles" kind="captions" src="detrack.vtt" srclang="es">
  HTML5 Video not supported 
</video>


See also

track element
track object
Make your videos accessible with Timed Text Tracks

 

 

Show:
© 2015 Microsoft