Table of Contents

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.

See also on MDN

Constructors

AudioTrackList()

public AudioTrackList()

Properties

Length

The read-only AudioTrackList
property length returns the number of entries in the
AudioTrackList, 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 the
AudioTrackList as an array of objects of type AudioTrack.

Remarks

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 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

id string

Returns

AudioTrack

An AudioTrack object indicating the first track found within the
AudioTrackList 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