Class: LocalAudioTrack

LocalAudioTrack

A LocalAudioTrack is an AudioTrack representing audio that your Client sends to a Room.


Extends

Methods


attach()

Attach the AudioTrack to a newly created <audio> element.

Inherited From:
Overrides:
Returns:
Type
HTMLElement
Example
var audioEl = audioTrack.attach();
document.getElementById('div#audio-track-container').appendChild(audioEl);

detach()

Detach the AudioTrack from any and all previously attached <audio> elements.

Inherited From:
Overrides:
Returns:
Type
Array.<HTMLElement>
Example
var detachedAudioEls = audioTrack.detach();

disable()

Disable the LocalAudioTrack. This is effectively "mute".

Overrides:
Fires:
Returns:
Type
this

enable()

Enable the LocalAudioTrack. This is effectively "unmute".

Overrides:
Fires:
Returns:
Type
this

enable( [enabled])

Enable or disable the LocalAudioTrack. This is effectively "unmute" or "mute".

Parameters:
Name Type Argument Description
enabled boolean <optional>

Specify false to mute the LocalAudioTrack

Overrides:
Fires:
Returns:
Type
this

stop()

Calls stop on the underlying MediaStreamTrack. If you choose to stop a LocalTrack, you should use LocalMedia#removeTrack to remove it after stopping. You do not need to stop a track before using LocalTrack#disable or LocalMedia#removeTrack.

Inherited From:
Overrides:
Returns:
Type
this

Events


disabled

The Track was disabled. For AudioTracks this means "muted", and for VideoTracks this means "paused".

Parameters:
Name Type Description
track Track

The Track that was disabled

Inherited From:
Overrides:

enabled

The Track was enabled. For AudioTracks this means "unmuted", and for VideoTracks this means "unpaused".

Parameters:
Name Type Description
track Track

The Track that was enabled

Inherited From:
Overrides:

started

The Track started. This means that the Track contains enough audio or video to begin playback.

Parameters:
Name Type Description
track Track

The Track that started

Inherited From:
Overrides: