Classes

Classes

AudioTrack
Client
LocalAudioTrack
LocalAudioTrackStats
LocalMedia
LocalParticipant
LocalTrack
LocalTrackStats
LocalVideoTrack
LocalVideoTrackStats
Media
Participant
RemoteAudioTrackStats
RemoteTrackStats
RemoteVideoTrackStats
Room
StatsReport
Track
TrackStats
VideoTrack

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:

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:

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:

error

Your Client has run into an error.

Parameters:
Name Type Description
error Error

The Error

Example
var initialToken = getAccessToken();
var client = new Twilio.Video.Client(initialToken);

client.on('error', function(error) {
 console.error(error);
});

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:

trackAdded

A Track was added to this Media object.

Parameters:
Name Type Description
track Track

The Track that was added

Inherited From:

trackDimensionsChanged

The dimensions of a VideoTrack on this Media object changed.

Parameters:
Name Type Description
track VideoTrack

The VideoTrack whose dimensions changed

Inherited From:

trackDisabled

A Track on this Media object was disabled.

Parameters:
Name Type Description
track Track

The Track that was disabled

Inherited From:

trackEnabled

A Track on this Media object was enabled.

Parameters:
Name Type Description
track Track

The Track that was enabled

Inherited From:

trackRemoved

A Track was removed from this Media object.

Parameters:
Name Type Description
track Track

The Track that was removed

Inherited From:

trackStarted

A Track on this Media object was started.

Parameters:
Name Type Description
track Track

The Track that was started

Inherited From:

disconnected

The Participant has disconnected.

Parameters:
Name Type Description
participant Participant

The Participant that disconnected.

Inherited From:

trackAdded

A Track was added by the Participant.

Parameters:
Name Type Description
track Track

The Track that was added

Inherited From:

trackDimensionsChanged

One of the Participant's VideoTrack's dimensions changed.

Parameters:
Name Type Description
track VideoTrack

The VideoTrack whose dimensions changed

Inherited From:

trackDisabled

A Track was disabled by the Participant.

Parameters:
Name Type Description
track Track

The Track that was disabled

Inherited From:

trackEnabled

A Track was enabled by the Participant.

Parameters:
Name Type Description
track Track

The Track that was enabled

Inherited From:

trackRemoved

A Track was removed by the Participant.

Parameters:
Name Type Description
track Track

The Track that was removed

Inherited From:

trackStarted

One of the Participant's Tracks started.

Parameters:
Name Type Description
track Track

The Track that started

Inherited From:

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:

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:

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:

dimensionsChanged

The VideoTrack's dimensions changed.

Parameters:
Name Type Description
track VideoTrack

The VideoTrack whose dimensions changed

Inherited From:

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:

trackAdded

A Track was added to this Media object.

Parameters:
Name Type Description
track Track

The Track that was added


trackDimensionsChanged

The dimensions of a VideoTrack on this Media object changed.

Parameters:
Name Type Description
track VideoTrack

The VideoTrack whose dimensions changed


trackDisabled

A Track on this Media object was disabled.

Parameters:
Name Type Description
track Track

The Track that was disabled


trackEnabled

A Track on this Media object was enabled.

Parameters:
Name Type Description
track Track

The Track that was enabled


trackRemoved

A Track was removed from this Media object.

Parameters:
Name Type Description
track Track

The Track that was removed


trackStarted

A Track on this Media object was started.

Parameters:
Name Type Description
track Track

The Track that was started


disconnected

The Participant has disconnected.

Parameters:
Name Type Description
participant Participant

The Participant that disconnected.


trackAdded

A Track was added by the Participant.

Parameters:
Name Type Description
track Track

The Track that was added


trackDimensionsChanged

One of the Participant's VideoTrack's dimensions changed.

Parameters:
Name Type Description
track VideoTrack

The VideoTrack whose dimensions changed


trackDisabled

A Track was disabled by the Participant.

Parameters:
Name Type Description
track Track

The Track that was disabled


trackEnabled

A Track was enabled by the Participant.

Parameters:
Name Type Description
track Track

The Track that was enabled


trackRemoved

A Track was removed by the Participant.

Parameters:
Name Type Description
track Track

The Track that was removed


trackStarted

One of the Participant's Tracks started.

Parameters:
Name Type Description
track Track

The Track that started


disconnected

Your Client was disconnected from the Room and all other Participants.

Parameters:
Name Type Description
room Room

The Room your Client was disconnected from

Example
myRoom.on('disconnected', function() {
  myRoom.localParticipant.media.detach();
});

participantConnected

A Participant joined the Room.

Parameters:
Name Type Description
participant Participant

The Participant who joined

Example
myRoom.on('participantConnected', function(participant) {
  console.log(participant.identity + ' joined the Room');

  // Get the participant's Media,
  var participantMedia = participant.media;

  // And attach it to your application's view.
  var participantView = document.getElementById('participant-view');
  participantMedia.attach(participantView);
  participantVideos.appendChild(participantView);
});

participantDisconnected

A Participant left the Room.

Parameters:
Name Type Description
participant Participant

The Participant who left

Example
myRoom.on('participantDisconnected', function(participant) {
  console.log(participant.identity + ' left the Room');
});

recordingStarted

The Room is now being recorded


recordingStopped

The Room is no longer being recorded


trackAdded

A Track was added by a Participant in the Room.

Parameters:
Name Type Description
track Track

The Track that was added

participant Participant

The Participant who added the Track


trackDimensionsChanged

One of the Participant's VideoTrack's dimensions changed.

Parameters:
Name Type Description
track VideoTrack

The VideoTrack whose dimensions changed

participant Participant

The Participant whose VideoTrack's dimensions changed


trackDisabled

A Track was disabled by a Participant in the Room.

Parameters:
Name Type Description
track Track

The Track that was disabled

participant Participant

The Participant who disabled the Track


trackEnabled

A Track was enabled by a Participant in the Room.

Parameters:
Name Type Description
track Track

The Track that was enabled

participant Participant

The Participant who enabled the Track


trackRemoved

A Track was removed by a Participant in the Room.

Parameters:
Name Type Description
track Track

The Track that was removed

participant Participant

The Participant who removed the Track


trackStarted

One of a Participant's Tracks in the Room started.

Parameters:
Name Type Description
track Track

The Track that started

participant Participant

The Participant whose Track started


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


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


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


dimensionsChanged

The VideoTrack's dimensions changed.

Parameters:
Name Type Description
track VideoTrack

The VideoTrack whose dimensions changed


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:

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:

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: