Table of Contents

Class AudioTrack

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The AudioTrack interface represents a single audio track from one of the HTML media elements, audio or video.

[Value("AudioTrack")]
public class AudioTrack
Inheritance
AudioTrack
Inherited Members

Remarks

The most common use for accessing an AudioTrack object is to toggle its Enabled property in order to mute and unmute the track.

See also on MDN

Constructors

AudioTrack()

public AudioTrack()

Properties

Enabled

The AudioTrack property
enabled specifies whether or not the described audio
track is currently enabled for use. If the track is disabled by setting
enabled to false, the track is muted and does not produce
audio.

[Value("enabled")]
public bool Enabled { get; set; }

Property Value

bool

The enabled property is a Boolean whose value is true if the
track is enabled; enabled tracks produce audio while the media is playing. Setting
enabled to false effectively mutes the audio track, preventing
it from contributing to the media's audio performance.

Remarks

Id

The id property contains a
string which uniquely identifies the track represented by the
AudioTrack.

[Value("id")]
public string Id { get; }

Property Value

string

A string which identifies the track, suitable for use when calling
GetTrackById(string) on an
AudioTrackList such as the one specified by a media element's
AudioTracks property.

Remarks

This ID can be used with the
GetTrackById(string) method to locate a specific track within
the media associated with a media element. The track ID can also be used as the fragment of a URL that loads the specific track
(if the media supports media fragments).

See also on MDN

Kind

The kind property contains a
string indicating the category of audio contained in the
AudioTrack.

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

Property Value

string

A string specifying the type of content the media represents. The
string is one of those found in Audio track kind strings below.

Remarks

The kind can be used
to determine the scenarios in which specific tracks should be enabled or disabled. See
Audio track kind strings for a list of the kinds available for audio tracks.

See also on MDN

Label

The read-only AudioTrack
property label returns a string specifying the audio
track's human-readable label, if one is available; otherwise, it returns an empty
string.

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

Property Value

string

A string specifying the track's human-readable label, if one is
available in the track metadata. Otherwise, an empty string ("") is
returned.For example, a track whose Kind is
"commentary" might have a label such as
"Commentary with director Mark Markmarkimark and star Donna Donnalidon".

Remarks

Language

The read-only AudioTrack
property language returns a string identifying the
language used in the audio track.

[Value("language")]
public string Language { get; }

Property Value

string

A string specifying the BCP 47 ({{RFC(5646)}}) format language tag of
the primary language used in the audio track, or an empty string ("") if
the language is not specified or known, or if the track doesn't contain speech.For example, if the primary language used in the track is United States English, this
value would be "en-US". For Brazilian Portuguese, the value would be
"pt-BR".

Remarks

For tracks that include multiple languages
(such as a movie in English in which a few lines are spoken in other languages), this
should be the video's primary language.

See also on MDN

SourceBuffer

The read-only AudioTrack
property sourceBuffer returns the
SourceBuffer that created the track, or null if the track was not
created by a SourceBuffer or the SourceBuffer has been
removed from the SourceBuffers attribute of its parent
media source.

[Value("sourceBuffer")]
public SourceBuffer? SourceBuffer { get; }

Property Value

SourceBuffer

A SourceBuffer or null.

Remarks