Table of Contents

Class HTMLTrackElement

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The HTMLTrackElement interface represents an HTML {{HTMLElement("track")}} element within the DOM. This element can be used as a child of either {{HTMLElement("audio")}} or {{HTMLElement("video")}} to specify a text track containing information such as closed captions or subtitles.

[Value("HTMLTrackElement")]
public class HTMLTrackElement : HTMLElement
Inheritance
HTMLTrackElement
Inherited Members

Remarks

-The HTML element implementing this interface: track.

See also on MDN

Constructors

HTMLTrackElement()

public HTMLTrackElement()

Fields

ERROR

[Value("ERROR")]
public const ushort ERROR = 3

Field Value

ushort

LOADED

[Value("LOADED")]
public const ushort LOADED = 2

Field Value

ushort

LOADING

[Value("LOADING")]
public const ushort LOADING = 1

Field Value

ushort

NONE

[Value("NONE")]
public const ushort NONE = 0

Field Value

ushort

Properties

Default

The default property of the HTMLTrackElement interface represents whether the track will be enabled if the user's preferences do not indicate that another track would be more appropriate. It reflects the {{htmlelement("track")}} element's boolean default attribute, returning true if present and false otherwise.

[Value("default")]
public bool Default { get; set; }

Property Value

bool

A Boolean.

Remarks

Kind

The kind property of the HTMLTrackElement interface represents the type of track, or how the text track is meant to be used. It reflects the {{htmlelement("track")}} element's enumerated kind attribute.

[Value("kind")]
public string Kind { get; set; }

Property Value

string

A string; lowercase captions, descriptions, chapters, subtitles or metadata.

Remarks

If no kind is set, subtitles is used. If the attribute is not set to one of the valid enumerated values, it is invalid and metadata is used. Other valid values include captions, descriptions, and chapters.

-Track
-Label

See also on MDN

Label

The label property of the HTMLTrackElement represents the user-readable title displayed when listing subtitle, caption, and audio descriptions for a track. It reflects the {{htmlelement("track")}} element's label attribute.

[Value("label")]
public string Label { get; set; }

Property Value

string

A string.

Remarks

ReadyState

The readyState read-only property of the HTMLTrackElement interface returns a number representing the {{HTMLElement("track")}} element's text track readiness state:

[Value("readyState")]
public ushort ReadyState { get; }

Property Value

ushort

A number; 0, 1, 2, or 3.

Remarks

Src

The src property of the HTMLTrackElement interface reflects the value of
the track element's src attribute, which
indicates the URL of the text track's data.

[Value("src")]
public string Src { get; set; }

Property Value

string

A string containing the URL of the text track data.

Remarks

Srclang

The srclang property of the HTMLTrackElement interface reflects the value of
the track element's srclang attribute or the empty string if not defined.

[Value("srclang")]
public string Srclang { get; set; }

Property Value

string

A string.

Remarks

The srclang attribute is a BCP 47 language tag indicating the language of the text track's data.

-HTMLTrackElement
-track

See also on MDN

Track

The track read-only property of the HTMLTrackElement interface returns a TextTrack object corresponding to the text track of the {{HTMLElement("track")}} element.

[Value("track")]
public TextTrack Track { get; }

Property Value

TextTrack

A TextTrack object.

Remarks