W3cubDocs

/DOM

HTMLTrackElement

The HTMLTrackElement

Properties

Inherits properties from its parent, HTMLElement.

HTMLTrackElement.kind
Is a DOMString that reflects the kind HTML attribute, indicating how the text track is meant to be used. Possible values are: subtitles, captions, descriptions, chapters, metadata.
HTMLTrackElement.src
Is a DOMString that reflects the src HTML attribute, indicating the address of the text track data.
HTMLTrackElement.srclang
Is a DOMString that reflects the srclang HTML attribute, indicating the language of the text track data.
HTMLTrackElement.label
Is a DOMString that reflects the label HTML attribute, indicating a user-readable title for the track.
HTMLTrackElement.default
Is a Boolean reflects the default HTML attribute, indicating that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate.
HTMLTrackElement.readyState Read only
Returns an unsigned short that show the readiness state of the track:
Constant Value Description
NONE 0 Indicates that the text track's cues have not been obtained.
LOADING 1 Indicates that the text track is loading and there have been no fatal errors encountered so far. Further cues might still be added to the track by the parser.
LOADED 2 Indicates that the text track has been loaded with no fatal errors.
ERROR 3 Indicates that the text track was enabled, but when the user agent attempted to obtain it, this failed in some way. Some or all of the cues are likely missing and will not be obtained.
HTMLTrackElement.track Read only
Returns TextTrack is the track element's text track data.
track Read only TextTrack The track element's text track data.

Methods

No specific method; inherits methods from its parent, HTMLElement.

Specifications

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 23 Yes 31
31
Prior to Firefox 50, text tracks would only load if the <track> element is in a document.
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No 12 Yes
default 23 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No 12 Yes
kind 23 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No 12 Yes
label 23 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No 12 Yes
readyState 23 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No 12 Yes
src 23 Yes 31
31
Setting the src property did not work properly in versions prior to 50.
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No 12 Yes
srclang 23 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No 12 Yes
track 23 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No 12 Yes
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support Yes 25 Yes 31
31
Prior to Firefox 50, text tracks would only load if the <track> element is in a document.
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
12 Yes ?
default Yes 25 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
12 Yes ?
kind Yes 25 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
12 Yes ?
label Yes 25 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
12 Yes ?
readyState Yes 25 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
12 Yes ?
src Yes 25 Yes 31
31
Setting the src property did not work properly in versions prior to 50.
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
12 Yes ?
srclang Yes 25 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
12 Yes ?
track Yes 25 Yes 31
31
24 — 30
Disabled
Disabled From version 24 until version 30 (exclusive): this feature is behind the media.webvtt.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
12 Yes ?

See also

  • The HTML element implementing this interface: <track>.

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLTrackElement