Table of Contents

Class TextTrackList

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The TextTrackList interface is used to represent a list of the text tracks defined for the associated video or audio element, with each track represented by a separate TextTrack object in the list.

[Value("TextTrackList")]
public class TextTrackList : EventTarget
Inheritance
TextTrackList
Inherited Members

Remarks

Text tracks can be added to a media element declaratively using the {{HTMLElement("track")}} element or programmatically using the 'HTMLMediaElement.AddTextTrack' method.

An instance of this object can be retrieved using the 'HTMLMediaElement.TextTracks' property of an 'HTMLMediaElement' object.

For a given 'HTMLMediaElement' object media, the individual tracks can be accessed using:

See also on MDN

Constructors

TextTrackList()

public TextTrackList()

Properties

Length

The read-only TextTrackList
property length returns the number of entries in the
TextTrackList, each of which is a TextTrack representing
one track in the media element.

[Value("length")]
public ulong Length { get; }

Property Value

ulong

A number indicating how many text tracks are included in the
TextTrackList. Each track can be accessed by treating the
TextTrackList as an array of objects of type TextTrack.

Remarks

A value of 0 indicates that there are no text
tracks in the media.

See also on MDN

Onaddtrack

[Value("onaddtrack")]
public EventHandlerNonNull Onaddtrack { get; set; }

Property Value

EventHandlerNonNull

Onchange

[Value("onchange")]
public EventHandlerNonNull Onchange { get; set; }

Property Value

EventHandlerNonNull

Onremovetrack

[Value("onremovetrack")]
public EventHandlerNonNull Onremovetrack { get; set; }

Property Value

EventHandlerNonNull

Methods

GetTrackById(string)

The TextTrackList method
getTrackById() returns the first
TextTrack object from the track list whose
id matches the
specified string. This lets you find a specified track if you know its ID
string.

[Value("getTrackById")]
public TextTrack? GetTrackById(string id)

Parameters

id string

Returns

TextTrack

A TextTrack object indicating the first track found within the
TextTrackList whose id matches the specified string. If no
match is found, this method returns null.The tracks are searched in their natural order; that is, in the order defined by the
media resource itself, or, if the resource doesn't define an order, the relative order
in which the tracks are declared by the media resource.

Remarks