Classes
- AccessTokenExpiredError
- AccessTokenGrantsInvalidError
- AccessTokenHeaderInvalidError
- AccessTokenInvalidError
- AccessTokenIssuerInvalidError
- AccessTokenNotYetValidError
- AccessTokenSignatureInvalidError
- AudioTrack
- ConfigurationAcquireFailedError
- ConfigurationAcquireTurnFailedError
- LocalAudioTrack
- LocalAudioTrackPublication
- LocalAudioTrackStats
- LocalDataTrack
- LocalDataTrackPublication
- LocalParticipant
- LocalTrackPublication
- LocalTrackStats
- LocalVideoTrack
- LocalVideoTrackPublication
- LocalVideoTrackStats
- MediaClientLocalDescFailedError
- MediaClientRemoteDescFailedError
- MediaConnectionError
- MediaDTLSTransportFailedError
- MediaNoSupportedCodecError
- MediaServerLocalDescFailedError
- MediaServerRemoteDescFailedError
- NetworkQualityAudioStats
- NetworkQualityBandwidthStats
- NetworkQualityFractionLostStats
- NetworkQualityLatencyStats
- NetworkQualityMediaStats
- NetworkQualityRecvStats
- NetworkQualitySendOrRecvStats
- NetworkQualitySendStats
- NetworkQualityStats
- NetworkQualityVideoStats
- Participant
- ParticipantDuplicateIdentityError
- ParticipantIdentityCharsInvalidError
- ParticipantIdentityInvalidError
- ParticipantIdentityTooLongError
- ParticipantMaxTracksExceededError
- ParticipantNotFoundError
- PreflightTest
- RemoteAudioTrack
- RemoteAudioTrackPublication
- RemoteAudioTrackStats
- RemoteDataTrack
- RemoteDataTrackPublication
- RemoteParticipant
- RemoteTrackPublication
- RemoteTrackStats
- RemoteVideoTrack
- RemoteVideoTrackPublication
- RemoteVideoTrackStats
- Room
- RoomAudioOnlyFlagNotSupportedError
- RoomCompletedError
- RoomConnectFailedError
- RoomCreateFailedError
- RoomInvalidParametersError
- RoomMaxParticipantsExceededError
- RoomMaxParticipantsOutOfRangeError
- RoomMediaRegionInvalidError
- RoomMediaRegionUnavailableError
- RoomNameCharsInvalidError
- RoomNameInvalidError
- RoomNameTooLongError
- RoomNotFoundError
- RoomRoomExistsError
- RoomStatusCallbackInvalidError
- RoomStatusCallbackMethodInvalidError
- RoomStatusInvalidError
- RoomSubscriptionOperationNotSupportedError
- RoomTimeoutOutOfRangeError
- RoomTrackKindNotSupportedError
- RoomTypeInvalidError
- SignalingConnectionDisconnectedError
- SignalingConnectionError
- SignalingConnectionTimeoutError
- SignalingIncomingMessageInvalidError
- SignalingOutgoingMessageInvalidError
- SignalingServerBusyError
- StatsReport
- Track
- TrackInvalidError
- TrackNameCharsInvalidError
- TrackNameInvalidError
- TrackNameIsDuplicatedError
- TrackNameTooLongError
- TrackPublication
- TrackServerTrackCapacityReachedError
- TrackStats
- TwilioError
- VideoTrack
Events
-
disabled
-
The AudioTrack was disabled, i.e. "muted".
Parameters:
Name Type Description trackAudioTrack The AudioTrack that was disabled
-
enabled
-
The AudioTrack was enabled, i.e. "unmuted".
Parameters:
Name Type Description trackAudioTrack The AudioTrack that was enabled
-
started
-
The AudioTrack started. This means there is enough audio data to begin playback.
Parameters:
Name Type Description trackAudioTrack The AudioTrack that started
-
event
-
The SDK raised an EventListenerEvent.
Parameters:
Name Type Description eventEventListenerEvent Context about the event raised by the SDK. This can be one of the following:
-
disabled
-
The LocalAudioTrack was disabled, i.e. "muted".
Parameters:
Name Type Description trackLocalAudioTrack The LocalAudioTrack that was disabled
- Overrides:
-
enabled
-
The LocalAudioTrack was enabled, i.e. "unmuted".
Parameters:
Name Type Description trackLocalAudioTrack The LocalAudioTrack that was enabled
- Overrides:
-
started
-
The LocalAudioTrack started. This means there is enough audio data to begin playback.
Parameters:
Name Type Description trackLocalAudioTrack The LocalAudioTrack that started
- Overrides:
-
stopped
-
The LocalAudioTrack stopped, either because LocalAudioTrack#stop or LocalAudioTrack#restart was called or because the underlying MediaStreamTrack ended.
Parameters:
Name Type Description trackLocalAudioTrack The LocalAudioTrack that stopped
-
trackDisabled
-
The published Track was disabled.
- Inherited From:
- Overrides:
-
trackEnabled
-
The published Track was enabled.
- Inherited From:
- Overrides:
-
trackDisabled
-
The published Track was disabled.
- Inherited From:
- Overrides:
-
trackEnabled
-
The published Track was enabled.
- Inherited From:
- Overrides:
-
disconnected
-
The Participant has disconnected.
Parameters:
Name Type Description participantParticipant The Participant that disconnected.
- Inherited From:
- Overrides:
-
networkQualityLevelChanged
-
The Participant's NetworkQualityLevel changed.
Parameters:
Name Type Argument Description networkQualityLevelNetworkQualityLevel The new NetworkQualityLevel
networkQualityStatsNetworkQualityStats <nullable>
The NetworkQualityStats based on which NetworkQualityLevel is calculated, if any
- Inherited From:
- Overrides:
-
reconnected
-
The LocalParticipant has reconnected to the Room after a signaling connection disruption.
- Overrides:
-
reconnecting
-
The LocalParticipant is reconnecting to the Room after a signaling connection disruption.
- Overrides:
-
trackDimensionsChanged
-
One of the LocalParticipant's LocalVideoTrack's dimensions changed.
Parameters:
Name Type Description trackLocalVideoTrack The LocalVideoTrack whose dimensions changed
- Overrides:
-
trackDisabled
-
A LocalTrack was disabled by the LocalParticipant.
Parameters:
Name Type Description trackLocalTrack The LocalTrack that was disabled
-
trackEnabled
-
A LocalTrack was enabled by the LocalParticipant.
Parameters:
Name Type Description trackLocalTrack The LocalTrack that was enabled
-
trackPublicationFailed
-
A LocalTrack failed to publish. Check the error message for more information. In a Large Group Room (Maximum Participants greater than 50), this event is raised with a ParticipantMaxTracksExceededError either when attempting to publish the LocalTrack will exceed the Maximum Published Tracks limit of 16, or the LocalTrack is part of a set of LocalTracks which along with the published Tracks exceeds 16.
Parameters:
Name Type Description errorTwilioError A TwilioError explaining why publication failed
localTrackLocalTrack The LocalTrack that failed to publish
-
trackPublished
-
A LocalTrack was successfully published.
Parameters:
Name Type Description publicationLocalTrackPublication The resulting LocalTrackPublication for the published LocalTrack
-
trackStarted
-
One of the LocalParticipant's LocalTracks started.
Parameters:
Name Type Description trackLocalTrack The LocalTrack that started
- Overrides:
-
trackStopped
-
One of the LocalParticipant's LocalTracks stopped, either because LocalTrack#stop was called or because the underlying MediaStreamTrack ended).
Parameters:
Name Type Description trackLocalTrack The LocalTrack that stopped
-
trackDisabled
-
The published Track was disabled.
- Inherited From:
- Overrides:
-
trackEnabled
-
The published Track was enabled.
- Inherited From:
- Overrides:
-
dimensionsChanged
-
The VideoTrack's dimensions changed.
Parameters:
Name Type Description trackVideoTrack The VideoTrack whose dimensions changed
- Inherited From:
- Overrides:
-
disabled
-
The LocalVideoTrack was disabled, i.e. "muted".
Parameters:
Name Type Description trackLocalVideoTrack The LocalVideoTrack that was disabled
- Overrides:
-
enabled
-
The LocalVideoTrack was enabled, i.e. "unmuted".
Parameters:
Name Type Description trackLocalVideoTrack The LocalVideoTrack that was enabled
- Overrides:
-
started
-
The LocalVideoTrack started. This means there is enough video data to begin playback.
Parameters:
Name Type Description trackLocalVideoTrack The LocalVideoTrack that started
- Overrides:
-
stopped
-
The LocalVideoTrack stopped, either because LocalVideoTrack#stop or LocalVideoTrack#restart was called or because the underlying MediaStreamTrack ended.
Parameters:
Name Type Description trackLocalVideoTrack The LocalVideoTrack that stopped
-
trackDisabled
-
The published Track was disabled.
- Inherited From:
- Overrides:
-
trackEnabled
-
The published Track was enabled.
- Inherited From:
- Overrides:
-
disconnected
-
The Participant has disconnected.
Parameters:
Name Type Description participantParticipant The Participant that disconnected.
-
networkQualityLevelChanged
-
The Participant's NetworkQualityLevel changed.
Parameters:
Name Type Argument Description networkQualityLevelNetworkQualityLevel The new NetworkQualityLevel
networkQualityStatsNetworkQualityStats <nullable>
The NetworkQualityStats based on which NetworkQualityLevel is calculated, if any
-
reconnected
-
The Participant has reconnected to the Room after a signaling connection disruption.
-
reconnecting
-
The Participant is reconnecting to the Room after a signaling connection disruption.
-
trackDimensionsChanged
-
One of the Participant's VideoTrack's dimensions changed.
Parameters:
Name Type Description trackVideoTrack The VideoTrack whose dimensions changed
-
trackStarted
-
One of the Participant's Tracks started.
Parameters:
Name Type Description trackTrack The Track that started
-
completed
-
Preflight test has completed successfully.
Parameters:
Name Type Description reportPreflightTestReport results of the test.
-
failed
-
Preflight test has encountered a failed and is now stopped.
Parameters:
Name Type Description errorTwilioError | Error error object
-
progress
-
Emitted to indicate progress of the test
Parameters:
Name Type Description progressPreflightProgress indicates the status completed.
-
disabled
-
The RemoteAudioTrack was disabled, i.e. "muted".
Parameters:
Name Type Description trackRemoteAudioTrack The RemoteAudioTrack that was disabled
- Overrides:
-
enabled
-
The RemoteAudioTrack was enabled, i.e. "unmuted".
Parameters:
Name Type Description trackRemoteAudioTrack The RemoteAudioTrack that was enabled
- Overrides:
-
started
-
The RemoteAudioTrack started. This means there is enough audio data to begin playback.
Parameters:
Name Type Description trackRemoteAudioTrack The RemoteAudioTrack that started
- Overrides:
-
switchedOff
-
A RemoteAudioTrack was switched off.
Parameters:
Name Type Description trackRemoteAudioTrack The RemoteAudioTrack that was switched off
-
switchedOn
-
A RemoteAudioTrack was switched on.
Parameters:
Name Type Description trackRemoteAudioTrack The RemoteAudioTrack that was switched on
-
subscribed
-
Your LocalParticipant subscribed to the RemoteAudioTrack.
Parameters:
Name Type Description trackRemoteAudioTrack the RemoteAudioTrack that was subscribed to
-
subscriptionFailed
-
Your LocalParticipant failed to subscribe to the RemoteAudioTrack.
Parameters:
Name Type Description errorTwilioError the reason the RemoteAudioTrack could not be subscribed to
-
trackDisabled
-
The RemoteAudioTrack was disabled.
-
trackEnabled
-
The RemoteAudioTrack was enabled.
-
unsubscribed
-
Your LocalParticipant unsubscribed from the RemoteAudioTrack.
Parameters:
Name Type Description trackRemoteAudioTrack the RemoteAudioTrack that was unsubscribed from
-
message
-
A message was received over the RemoteDataTrack.
Parameters:
Name Type Description datastring | ArrayBuffer trackRemoteDataTrack The RemoteDataTrack that received the message
-
switchedOff
-
A RemoteDataTrack was switched off.
Parameters:
Name Type Description trackRemoteDataTrack The RemoteDataTrack that was switched off
-
switchedOn
-
A RemoteDataTrack was switched on.
Parameters:
Name Type Description trackRemoteDataTrack The RemoteDataTrack that was switched on
-
subscribed
-
Your LocalParticipant subscribed to the RemoteDataTrack.
Parameters:
Name Type Description trackRemoteDataTrack the RemoteDataTrack that was subscribed to
-
subscriptionFailed
-
Your LocalParticipant failed to subscribe to the RemoteDataTrack.
Parameters:
Name Type Description errorTwilioError the reason the RemoteDataTrack could not be subscribed to
-
unsubscribed
-
Your LocalParticipant unsubscribed from the RemoteDataTrack.
Parameters:
Name Type Description trackRemoteDataTrack the RemoteDataTrack that was unsubscribed from
-
disconnected
-
The Participant has disconnected.
Parameters:
Name Type Description participantParticipant The Participant that disconnected.
- Inherited From:
- Overrides:
-
networkQualityLevelChanged
-
The Participant's NetworkQualityLevel changed.
Parameters:
Name Type Argument Description networkQualityLevelNetworkQualityLevel The new NetworkQualityLevel
networkQualityStatsNetworkQualityStats <nullable>
The NetworkQualityStats based on which NetworkQualityLevel is calculated, if any
- Inherited From:
- Overrides:
-
reconnected
-
The RemoteParticipant has reconnected to the Room after a signaling connection disruption.
- Overrides:
-
reconnecting
-
The RemoteParticipant is reconnecting to the Room after a signaling connection disruption.
- Overrides:
-
trackDimensionsChanged
-
One of the RemoteParticipant's RemoteVideoTrack's dimensions changed.
Parameters:
Name Type Description trackRemoteVideoTrack The RemoteVideoTrack whose dimensions changed
- Overrides:
-
trackDisabled
-
A RemoteTrack was disabled by the RemoteParticipant.
Parameters:
Name Type Description publicationRemoteTrackPublication The RemoteTrackPublication associated with the disabled RemoteTrack
-
trackEnabled
-
A RemoteTrack was enabled by the RemoteParticipant.
Parameters:
Name Type Description publicationRemoteTrackPublication The RemoteTrackPublication associated with the enabled RemoteTrack
-
trackMessage
-
A message was received over one of the RemoteParticipant's RemoteDataTracks.
Parameters:
Name Type Description datastring | ArrayBuffer trackRemoteDataTrack The RemoteDataTrack over which the message was received
-
trackPublished
-
A RemoteTrack was published by the RemoteParticipant after connecting to the Room. This event is not emitted for RemoteTracks that were published while the RemoteParticipant was connecting to the Room.
Parameters:
Name Type Description publicationRemoteTrackPublication The RemoteTrackPublication which represents the published RemoteTrack
Example
function trackPublished(publication) { console.log(`Track ${publication.trackSid} was published`); } room.on('participantConnected', participant => { // Handle RemoteTracks published while connecting to the Room. participant.trackPublications.forEach(trackPublished); // Handle RemoteTracks published after connecting to the Room. participant.on('trackPublished', trackPublished); }); -
trackPublishPriorityChanged
-
The RemoteTrackPublication's publish Track.Priority was changed by the RemoteParticipant.
Parameters:
Name Type Description priorityTrack.Priority the RemoteTrack's new publish Track.Priority;
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that changed priority
-
trackStarted
-
One of the RemoteParticipant's RemoteTracks started.
Parameters:
Name Type Description trackRemoteTrack The RemoteTrack that started
- Overrides:
-
trackSubscribed
-
A RemoteParticipant's RemoteTrack was subscribed to.
Parameters:
Name Type Description trackRemoteTrack The RemoteTrack that was subscribed to
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that was subscribed to
-
trackSubscriptionFailed
-
A RemoteParticipant's RemoteTrack could not be subscribed to.
Parameters:
Name Type Description errorTwilioError The reason the RemoteTrack could not be subscribed to
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that could not be subscribed to
-
trackSwitchedOff
-
A RemoteParticipant's RemoteTrack was subscribed to.
Parameters:
Name Type Description trackRemoteTrack The RemoteTrack that was switched off
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that was switched off
-
trackSwitchedOn
-
A RemoteParticipant's RemoteTrack was switched on.
Parameters:
Name Type Description trackRemoteTrack The RemoteTrack that was switched on.
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that was switched on
-
trackUnpublished
-
A RemoteTrack was unpublished by the RemoteParticipant.
Parameters:
Name Type Description publicationRemoteTrackPublication The RemoteTrackPublication which represents the unpublished RemoteTrack
-
trackUnsubscribed
-
A RemoteParticipant's RemoteTrack was unsubscribed from.
Parameters:
Name Type Description trackRemoteTrack The RemoteTrack that was unsubscribed from
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that was unsubscribed from
-
publishPriorityChanged
-
The RemoteTrack's publish Track.Priority was changed by the RemoteParticipant.
Parameters:
Name Type Description priorityTrack.Priority the RemoteTrack's new publish Track.Priority; RemoteTrackPublication#publishPriority is also updated accordingly
-
subscribed
-
Your LocalParticipant subscribed to the RemoteTrack.
Parameters:
Name Type Description trackRemoteTrack the RemoteTrack that was subscribed to
-
subscriptionFailed
-
Your LocalParticipant failed to subscribe to the RemoteTrack.
Parameters:
Name Type Description errorTwilioError the reason the RemoteTrack could not be subscribed to
-
trackDisabled
-
The RemoteTrack was disabled.
- Overrides:
-
trackEnabled
-
The RemoteTrack was enabled.
- Overrides:
-
trackSwitchedOff
-
The RemoteTrack was switched off.
Parameters:
Name Type Description trackRemoteTrack the RemoteTrack that was switched off
-
trackSwitchedOn
-
The RemoteTrack was switched on.
Parameters:
Name Type Description trackRemoteTrack the RemoteTrack that was switched on
-
unsubscribed
-
Your LocalParticipant unsubscribed from the RemoteTrack.
Parameters:
Name Type Description trackRemoteTrack the RemoteTrack that was unsubscribed from
-
dimensionsChanged
-
The RemoteVideoTrack's dimensions changed.
Parameters:
Name Type Description trackRemoteVideoTrack The RemoteVideoTrack whose dimensions changed
- Overrides:
-
disabled
-
The RemoteVideoTrack was disabled, i.e. "paused".
Parameters:
Name Type Description trackRemoteVideoTrack The RemoteVideoTrack that was disabled
- Overrides:
-
enabled
-
The RemoteVideoTrack was enabled, i.e. "resumed".
Parameters:
Name Type Description trackRemoteVideoTrack The RemoteVideoTrack that was enabled
- Overrides:
-
started
-
The RemoteVideoTrack started. This means there is enough video data to begin playback.
Parameters:
Name Type Description trackRemoteVideoTrack The RemoteVideoTrack that started
- Overrides:
-
switchedOff
-
A RemoteVideoTrack was switched off.
Parameters:
Name Type Description trackRemoteVideoTrack The RemoteVideoTrack that was switched off
-
switchedOn
-
A RemoteVideoTrack was switched on.
Parameters:
Name Type Description trackRemoteVideoTrack The RemoteVideoTrack that was switched on
-
subscribed
-
Your LocalParticipant subscribed to the RemoteVideoTrack.
Parameters:
Name Type Description trackRemoteVideoTrack the RemoteVideoTrack that was subscribed to
-
subscriptionFailed
-
Your LocalParticipant failed to subscribe to the RemoteVideoTrack.
Parameters:
Name Type Description errorTwilioError the reason the RemoteVideoTrack could not be subscribed to
-
trackDisabled
-
The RemoteVideoTrack was disabled.
-
trackEnabled
-
The RemoteVideoTrack was enabled.
-
unsubscribed
-
Your LocalParticipant unsubscribed from the RemoteVideoTrack.
Parameters:
Name Type Description trackRemoteVideoTrack the RemoteVideoTrack that was unsubscribed from
-
disconnected
-
Your LocalParticipant was disconnected from the Room and all other RemoteParticipants.
Parameters:
Name Type Argument Description roomRoom The Room your LocalParticipant was disconnected from
errorTwilioError <nullable>
Present when the LocalParticipant got disconnected from the Room unexpectedly
Example
myRoom.on('disconnected', function(room, error) { if (error) { console.log('Unexpectedly disconnected:', error); } myRoom.localParticipant.tracks.forEach(function(track) { track.stop(); track.detach(); }); }); -
dominantSpeakerChanged
-
The Dominant Speaker in the Room changed. Either the Dominant Speaker is a new RemoteParticipant or the Dominant Speaker has been reset and is now null.
Parameters:
Name Type Argument Description dominantSpeakerRemoteParticipant <nullable>
The Dominant Speaker in the Room, if any
-
participantConnected
-
A RemoteParticipant joined the Room. In Large Group Rooms (Maximum Participants greater than 50), this event is raised only when a RemoteParticipant publishes at least one LocalTrack.
Parameters:
Name Type Description participantRemoteParticipant The RemoteParticipant who joined
Example
myRoom.on('participantConnected', function(participant) { console.log(participant.identity + ' joined the Room'); }); -
participantDisconnected
-
A RemoteParticipant left the Room. In Large Group Rooms (Maximum Participants greater than 50), this event is raised only when a RemoteParticipant unpublishes all its LocalTracks.
Parameters:
Name Type Description participantRemoteParticipant The RemoteParticipant who left
Example
myRoom.on('participantDisconnected', function(participant) { console.log(participant.identity + ' left the Room'); participant.tracks.forEach(function(track) { track.detach().forEach(function(mediaElement) { mediaElement.remove(); }); }); }); -
participantReconnected
-
A RemoteParticipant has reconnected to the Room after a signaling connection disruption.
Parameters:
Name Type Description participantRemoteParticipant The RemoteParticipant that has reconnected.
Example
myRoom.on('participantReconnected', participant => { console.log(participant.identity + ' reconnected to the Room'); }); -
participantReconnecting
-
A RemoteParticipant is reconnecting to the Room after a signaling connection disruption.
Parameters:
Name Type Description participantRemoteParticipant The RemoteParticipant that is reconnecting.
Example
myRoom.on('participantReconnecting', participant => { console.log(participant.identity + ' is reconnecting to the Room'); }); -
reconnected
-
Your application successfully reconnected to the Room. When this event is emitted, the Room is in state "connected".
Example
myRoom.on('reconnected', () => { console.log('Reconnected!'); }); -
reconnecting
-
Your application is reconnecting to the Room. This happens when there is a disruption in your signaling connection and/or your media connection. When this event is emitted, the Room is in state "reconnecting". If reconnecting succeeds, the Room will emit a "reconnected" event.
Parameters:
Name Type Description errorMediaConnectionError | SignalingConnectionDisconnectedError A MediaConnectionError if your application is reconnecting due to a disruption in your media connection, or a SignalingConnectionDisconnectedError if your application is reconnecting due to a disruption in your signaling connection
Example
myRoom.on('reconnecting', error => { if (error.code === 53001) { console.log('Reconnecting your signaling connection!', error.message); } else if (error.code === 53405) { console.log('Reconnecting your media connection!', error.message); } }); -
recordingStarted
-
The Room is now being recorded
-
recordingStopped
-
The Room is no longer being recorded
-
trackDimensionsChanged
-
One of the RemoteParticipant's VideoTrack's dimensions changed.
Parameters:
Name Type Description trackRemoteVideoTrack The RemoteVideoTrack whose dimensions changed
participantRemoteParticipant The RemoteParticipant whose RemoteVideoTrack's dimensions changed
-
trackDisabled
-
A RemoteTrack was disabled by a RemoteParticipant in the Room.
Parameters:
Name Type Description publicationRemoteTrackPublication The RemoteTrackPublication that represents disabled RemoteTrack
participantRemoteParticipant The RemoteParticipant who disabled the RemoteTrack
-
trackEnabled
-
A RemoteTrack was enabled by a RemoteParticipant in the Room.
Parameters:
Name Type Description publicationRemoteTrackPublication The RemoteTrackPublication that represents enabled RemoteTrack
participantRemoteParticipant The RemoteParticipant who enabled the RemoteTrack
-
trackMessage
-
A message was received over one of the RemoteParticipant's RemoteDataTrack's.
Parameters:
Name Type Description datastring | ArrayBuffer trackRemoteDataTrack The RemoteDataTrack over which the message was received
participantRemoteParticipant The RemoteParticipant whose RemoteDataTrack received the message
-
trackPublished
-
A RemoteTrack was published by a RemoteParticipant after connecting to the Room. This event is not emitted for RemoteTracks that were published while the RemoteParticipant was connecting to the Room.
Parameters:
Name Type Description publicationRemoteTrackPublication The RemoteTrackPublication which represents the published RemoteTrack
participantRemoteParticipant The RemoteParticipant who published the RemoteTrack
Example
function trackPublished(publication, participant) { console.log(`RemoteParticipant ${participant.sid} published Track ${publication.trackSid}`); } // Handle RemoteTracks published after connecting to the Room. room.on('trackPublished', trackPublished); room.on('participantConnected', participant => { // Handle RemoteTracks published while connecting to the Room. participant.trackPublications.forEach(publication => trackPublished(publication, participant)); }); -
trackPublishPriorityChanged
-
The RemoteTrack's publish Track.Priority was changed by the RemoteParticipant.
Parameters:
Name Type Description priorityTrack.Priority the RemoteTrack's new publish Track.Priority;
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that changed priority
participantRemoteParticipant The RemoteParticipant whose RemoteTrack changed priority
-
trackStarted
-
One of a RemoteParticipant's RemoteTracks in the Room started.
Parameters:
Name Type Description trackRemoteTrack The RemoteTrack that started
participantRemoteParticipant The RemoteParticipant whose RemoteTrack started
-
trackSubscribed
-
A RemoteParticipant's RemoteTrack was subscribed to.
Parameters:
Name Type Description trackRemoteTrack The RemoteTrack that was subscribed
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that was subscribed to
participantRemoteParticipant The RemoteParticipant whose RemoteTrack was subscribed
Example
room.on('trackSubscribed', function(track, publication, participant) { var participantView = document.getElementById('participant-view-' + participant.identity); participantView.appendChild(track.attach()); }); -
trackSubscriptionFailed
-
A RemoteParticipant's RemoteTrack could not be subscribed to.
Parameters:
Name Type Description errorTwilioError The reason the RemoteTrack could not be subscribed to
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that could not be subscribed to
participantRemoteParticipant The RemoteParticipant whose RemoteTrack could not be subscribed to
-
trackSwitchedOff
-
A RemoteParticipant's RemoteTrack was switched off.
Parameters:
Name Type Description trackRemoteTrack The RemoteTrack that was switched off
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that was subscribed to
participantRemoteParticipant The RemoteParticipant whose RemoteTrack was switched off
-
trackSwitchedOn
-
A RemoteParticipant's RemoteTrack was switched on.
Parameters:
Name Type Description trackRemoteTrack The RemoteTrack that was switched on
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that was subscribed to
participantRemoteParticipant The RemoteParticipant whose RemoteTrack was switched on
-
trackUnpublished
-
A RemoteTrack was unpublished by a RemoteParticipant to the Room.
Parameters:
Name Type Description publicationRemoteTrackPublication The RemoteTrackPublication which represents the unpublished RemoteTrack
participantRemoteParticipant The RemoteParticipant who unpublished the RemoteTrack
-
trackUnsubscribed
-
A RemoteParticipant's RemoteTrack was unsubscribed from.
Parameters:
Name Type Description trackRemoteTrack The RemoteTrack that was unsubscribed
publicationRemoteTrackPublication The RemoteTrackPublication for the RemoteTrack that was unsubscribed from
participantRemoteParticipant The RemoteParticipant whose RemoteTrack was unsubscribed
Example
room.on('trackUnsubscribed', function(track, publication, participant) { track.detach().forEach(function(mediaElement) { mediaElement.remove(); }); }); -
trackDisabled
-
The published Track was disabled.
-
trackEnabled
-
The published Track was enabled.
-
dimensionsChanged
-
The VideoTrack's dimensions changed.
Parameters:
Name Type Description trackVideoTrack The VideoTrack whose dimensions changed
-
disabled
-
The VideoTrack was disabled, i.e. "paused".
Parameters:
Name Type Description trackVideoTrack The VideoTrack that was disabled
-
enabled
-
The VideoTrack was enabled, i.e. "unpaused".
Parameters:
Name Type Description trackVideoTrack The VideoTrack that was enabled
-
started
-
The VideoTrack started. This means there is enough video data to begin playback.
Parameters:
Name Type Description trackVideoTrack The VideoTrack that started