Class AudioTrackList
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The AudioTrackList interface is used to represent a list of the audio tracks contained within a given HTML media element, with each track represented by a separate AudioTrack object in the list.
[Value("AudioTrackList")]
public class AudioTrackList : EventTarget
- Inheritance
-
AudioTrackList
- Inherited Members
Remarks
Retrieve an instance of this object with 'HTMLMediaElement.AudioTracks'. The individual tracks can be accessed using array syntax.
Constructors
AudioTrackList()
public AudioTrackList()
Properties
Length
The read-only AudioTrackList
property length returns the number of entries in theAudioTrackList, each of which is an AudioTrack
representing one audio track in the media element. A value of 0 indicates that
there are no audio tracks in the media.
[Value("length")]
public ulong Length { get; }
Property Value
- ulong
A number indicating how many audio tracks are included in the
AudioTrackList. Each track can be accessed by treating theAudioTrackListas an array of objects of type AudioTrack.
Remarks
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 AudioTrackList method getTrackById() returns the first AudioTrack 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 AudioTrack? GetTrackById(string id)
Parameters
idstring
Returns
- AudioTrack
An AudioTrack object indicating the first track found within the
AudioTrackListwhoseidmatches 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.