The HTMLTrackElement
interface provides access to the properties of {{HTMLElement("track")}} elements, as well as methods to manipulate them.
Properties
Inherits properties from its parent, {{domxref("HTMLElement")}}.
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kind |
{{domxref("DOMString")}} | Reflects the {{htmlattrxref("kind", "track")}} HTML attribute, indicating how the text track is meant to be used. Possible values are: subtitles, captions, descriptions, chapters, metadata. See {{htmlattrxref("kind", "track")}} attribute documentation for details. | |||||||||||||||
src |
{{domxref("DOMString")}} | Reflects the {{htmlattrxref("src", "track")}} HTML attribute, indicating the address of the text track data. | |||||||||||||||
srclang |
{{domxref("DOMString")}} | Reflects the {{htmlattrxref("srclang", "track")}} HTML attribute, indicating the language of the text track data. | |||||||||||||||
label |
{{domxref("DOMString")}} | Reflects the {{htmlattrxref("label", "track")}} HTML attribute, indicating a user-readable title for the track. | |||||||||||||||
default |
{{domxref("Boolean")}} | Reflects the {{htmlattrxref("default", "track")}} 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. | |||||||||||||||
readyState {{ReadOnlyInline}} |
unsigned short |
The readiness state of the track.
|
|||||||||||||||
track {{ReadOnlyInline}} |
{{Domxref("TextTrack")}} | The track element's text track data. |
Methods
No specific method; inherits methods from its parent, {{domxref("HTMLElement")}}.
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', "the-video-element.html#the-track-element", "HTMLTrackElement")}} | {{Spec2('HTML WHATWG')}} | No change from {{SpecName("HTML5 W3C")}}. |
{{SpecName('HTML5 W3C', "embedded-content-0.html#the-track-element", "HTMLTrackElement")}} | {{Spec2('HTML5 W3C')}} | Initial definition. |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatGeckoDesktop("24")}}[1] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
src attribute settable |
{{CompatUnknown}} | {{CompatGeckoDesktop("50")}}[2][3] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatGeckoMobile("24")}}[1] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
src attribute settable |
{{CompatUnknown}} | {{CompatGeckoMobile("50")}}[2][3] | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
[1] The HTMLTrackElement
interface was added in Firefox 24, but was disabled by default behind the preference {{pref("media.webvtt.enabled")}}. The interface is enabled by default (along with all other WebVTT features) in Firefox 31.
[2] Until Firefox 50, the src
attribute is settable, but the change does not get handled properly. Starting in Firefox 50, existing track data is properly disposed of, new track data is loaded and put into effect, and so forth.
[3] Prior to Firefox 50, text tracks would only load if the {{HTMLElement("track")}} is in a document. Starting in Firefox 50, this incorrect requirement is lifted.
See also
- The HTML element implementing this interface: {{ HTMLElement("track") }}.