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:
Constructors
TextTrackList()
public TextTrackList()
Properties
Length
The read-only TextTrackList
property length returns the number of entries in theTextTrackList, 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 theTextTrackListas an array of objects of type TextTrack.
Remarks
A value of 0 indicates that there are no text
tracks in the media.
Onaddtrack
[Value("onaddtrack")]
public EventHandlerNonNull Onaddtrack { get; set; }
Property Value
Onchange
[Value("onchange")]
public EventHandlerNonNull Onchange { get; set; }
Property Value
Onremovetrack
[Value("onremovetrack")]
public EventHandlerNonNull Onremovetrack { get; set; }
Property Value
Methods
GetTrackById(string)
The TextTrackList methodgetTrackById() returns the first
TextTrack object from the track list whoseid 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
idstring
Returns
- TextTrack
A TextTrack object indicating the first track found within the
TextTrackListwhoseidmatches the specified string. If no
match is found, this method returnsnull.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.