RoomEvent
Defined in: client-sdk-js/src/events.ts:11
Events emitted by a Room instance.
Example
Section titled “Example”room.on(RoomEvent.TrackSubscribed, (track, publication, participant) => { // handle new track});Enumeration Members
Section titled “Enumeration Members”ActiveDeviceChanged
Section titled “ActiveDeviceChanged”ActiveDeviceChanged: "activeDeviceChanged";Defined in: client-sdk-js/src/events.ts:66
The active device for a kind has been switched via Room.switchActiveDevice.
args: (kind: MediaDeviceKind, deviceId: string)
ActiveSpeakersChanged
Section titled “ActiveSpeakersChanged”ActiveSpeakersChanged: "activeSpeakersChanged";Defined in: client-sdk-js/src/events.ts:203
Active speakers changed. List of speakers ordered by audio level. Includes the local participant.
args: (speakers: {@link Participant}[])
AudioPlaybackStatusChanged
Section titled “AudioPlaybackStatusChanged”AudioPlaybackStatusChanged: "audioPlaybackChanged";Defined in: client-sdk-js/src/events.ts:245
Audio playback status has changed. When canPlaybackAudio becomes
false, the application should display UI to prompt user interaction,
then call Room.startAudio.
ChatMessage
Section titled “ChatMessage”ChatMessage: "chatMessage";Defined in: client-sdk-js/src/events.ts:252
A message has been received or sent (chat, whiteboard, document, etc.).
args: (message: {@link Message}, participant?: {@link Participant})
Connected
Section titled “Connected”Connected: "connected";Defined in: client-sdk-js/src/events.ts:13
Successfully connected to the room.
ConnectionQualityChanged
Section titled “ConnectionQualityChanged”ConnectionQualityChanged: "connectionQualityChanged";Defined in: client-sdk-js/src/events.ts:224
The connection quality of a participant has changed.
args: (quality: {@link ConnectionQuality}, participant: {@link Participant})
ConnectionStateChanged
Section titled “ConnectionStateChanged”ConnectionStateChanged: "connectionStateChanged";Defined in: client-sdk-js/src/events.ts:37
Whenever the connection state of the room changes.
args: (state: {@link ConnectionState})
DataReceived
Section titled “DataReceived”DataReceived: "dataReceived";Defined in: client-sdk-js/src/events.ts:217
Data received from a remote participant via a DataChannel.
args: (payload: Uint8Array, participant?: {@link RemoteParticipant})
DataTrackPublished
Section titled “DataTrackPublished”DataTrackPublished: "dataTrackPublished";Defined in: client-sdk-js/src/events.ts:129
A remote participant has published a new data track.
args: (dataTrack: {@link DataTrackInfo}, participant: {@link RemoteParticipant})
DataTrackUnpublished
Section titled “DataTrackUnpublished”DataTrackUnpublished: "dataTrackUnpublished";Defined in: client-sdk-js/src/events.ts:136
A remote participant has unpublished a data track.
args: (dataTrackSid: string, participant: {@link RemoteParticipant})
Disconnected
Section titled “Disconnected”Disconnected: "disconnected";Defined in: client-sdk-js/src/events.ts:24
Disconnected from the room. This may be triggered by the server, by an explicit call to Room.disconnect, or because of a network failure.
args: (reason?: {@link DisconnectReason})
GroupCreated
Section titled “GroupCreated”GroupCreated: "groupCreated";Defined in: client-sdk-js/src/events.ts:303
A new group (breakout room) has been created.
args: (group: {@link GroupInfo})
GroupDeleted
Section titled “GroupDeleted”GroupDeleted: "groupDeleted";Defined in: client-sdk-js/src/events.ts:318
A group has been deleted. All participants in the group are returned to the main room.
args: (groupId: string)
GroupParticipantJoined
Section titled “GroupParticipantJoined”GroupParticipantJoined: "groupParticipantJoined";Defined in: client-sdk-js/src/events.ts:325
A participant has joined a group.
args: (groupId: string, participant: {@link RemoteParticipant} | {@link LocalParticipant})
GroupParticipantLeft
Section titled “GroupParticipantLeft”GroupParticipantLeft: "groupParticipantLeft";Defined in: client-sdk-js/src/events.ts:332
A participant has left a group (returned to the main room).
args: (groupId: string, participant: {@link RemoteParticipant} | {@link LocalParticipant})
GroupUpdated
Section titled “GroupUpdated”GroupUpdated: "groupUpdated";Defined in: client-sdk-js/src/events.ts:310
A group’s metadata or participant count has changed.
args: (group: {@link GroupInfo})
LocalAudioSilenceDetected
Section titled “LocalAudioSilenceDetected”LocalAudioSilenceDetected: "localAudioSilenceDetected";Defined in: client-sdk-js/src/events.ts:195
When a local audio track is published, the SDK checks whether there is complete silence on that track and emits this event. This allows applications to show UI informing users about hardware issues.
LocalTrackPublished
Section titled “LocalTrackPublished”LocalTrackPublished: "localTrackPublished";Defined in: client-sdk-js/src/events.ts:180
A local track was published successfully.
args: (publication: {@link LocalTrackPublication}, participant: {@link LocalParticipant})
LocalTrackUnpublished
Section titled “LocalTrackUnpublished”LocalTrackUnpublished: "localTrackUnpublished";Defined in: client-sdk-js/src/events.ts:188
A local track was unpublished. When a user stops sharing their screen by pressing “End” on the browser UI, this event will also fire.
args: (publication: {@link LocalTrackPublication}, participant: {@link LocalParticipant})
MediaDevicesChanged
Section titled “MediaDevicesChanged”MediaDevicesChanged: "mediaDevicesChanged";Defined in: client-sdk-js/src/events.ts:50
When input or output devices on the machine have changed.
MediaDevicesError
Section titled “MediaDevicesError”MediaDevicesError: "mediaDevicesError";Defined in: client-sdk-js/src/events.ts:58
When an error occurs while attempting to create a track from a device. Use MediaDeviceFailure.getFailure to get the specific reason.
args: (error: Error)
MessageDeleted
Section titled “MessageDeleted”MessageDeleted: "messageDeleted";Defined in: client-sdk-js/src/events.ts:259
Messages have been deleted.
args: (ids: string[], type?: string)
ParticipantAttributesChanged
Section titled “ParticipantAttributesChanged”ParticipantAttributesChanged: "participantAttributesChanged";Defined in: client-sdk-js/src/events.ts:108
Participant attributes have changed.
args: (changedAttributes: Record<string, string>, participant: {@link Participant})
ParticipantConnected
Section titled “ParticipantConnected”ParticipantConnected: "participantConnected";Defined in: client-sdk-js/src/events.ts:73
A remote participant has joined the room.
args: (participant: {@link RemoteParticipant})
ParticipantDisconnected
Section titled “ParticipantDisconnected”ParticipantDisconnected: "participantDisconnected";Defined in: client-sdk-js/src/events.ts:80
A remote participant has left the room.
args: (participant: {@link RemoteParticipant}, reason?: {@link DisconnectReason})
ParticipantMetadataChanged
Section titled “ParticipantMetadataChanged”ParticipantMetadataChanged: "participantMetadataChanged";Defined in: client-sdk-js/src/events.ts:94
Participant metadata has changed.
args: (prevMetadata: string | undefined, participant: {@link Participant})
ParticipantNameChanged
Section titled “ParticipantNameChanged”ParticipantNameChanged: "participantNameChanged";Defined in: client-sdk-js/src/events.ts:101
Participant’s display name has changed.
args: (name: string, participant: {@link Participant})
ParticipantPermissionsChanged
Section titled “ParticipantPermissionsChanged”ParticipantPermissionsChanged: "participantPermissionsChanged";Defined in: client-sdk-js/src/events.ts:238
A participant’s permissions have changed.
args: (prevPermissions: ParticipantPermission | undefined, participant: {@link Participant})
ParticipantUpdated
Section titled “ParticipantUpdated”ParticipantUpdated: "participantUpdated";Defined in: client-sdk-js/src/events.ts:87
A remote participant’s metadata or attributes have been updated.
args: (participant: {@link RemoteParticipant})
Reconnected
Section titled “Reconnected”Reconnected: "reconnected";Defined in: client-sdk-js/src/events.ts:30
Successfully reconnected to the room after a temporary disconnection.
Reconnecting
Section titled “Reconnecting”Reconnecting: "reconnecting";Defined in: client-sdk-js/src/events.ts:27
The SDK is attempting to reconnect to the room after a connection interruption.
RecordingStatusChanged
Section titled “RecordingStatusChanged”RecordingStatusChanged: "recordingStatusChanged";Defined in: client-sdk-js/src/events.ts:231
The room’s recording status has changed.
args: (recording: boolean)
RoomMetadataChanged
Section titled “RoomMetadataChanged”RoomMetadataChanged: "roomMetadataChanged";Defined in: client-sdk-js/src/events.ts:210
Room-level metadata has been updated by the server.
args: (metadata: string | undefined)
SignalConnected
Section titled “SignalConnected”SignalConnected: "signalConnected";Defined in: client-sdk-js/src/events.ts:16
The signal channel to the server has been established (join accepted).
SignalReconnecting
Section titled “SignalReconnecting”SignalReconnecting: "signalReconnecting";Defined in: client-sdk-js/src/events.ts:45
When the signal connection to the server has been interrupted. This is not always noticeable to users. It will resolve with RoomEvent.Reconnected once re-established. If media also fails, an additional RoomEvent.Reconnecting will be emitted.
StateDeleted
Section titled “StateDeleted”StateDeleted: "stateDeleted";Defined in: client-sdk-js/src/events.ts:273
A room shared state key has been deleted.
args: (key: string, participantSid?: string, participantIdentity?: string)
StateUpdated
Section titled “StateUpdated”StateUpdated: "stateUpdated";Defined in: client-sdk-js/src/events.ts:266
A room shared state key has been updated.
args: (key: string, value: string, participantSid?: string, participantIdentity?: string)
TokenRefreshed
Section titled “TokenRefreshed”TokenRefreshed: "tokenRefreshed";Defined in: client-sdk-js/src/events.ts:281
The server has pushed a new refresh token. Applications should persist this token for reconnection.
args: (token: string)
TrackMuted
Section titled “TrackMuted”TrackMuted: "trackMuted";Defined in: client-sdk-js/src/events.ts:166
A track has been muted. Fires on both remote and local participants.
args: (publication: {@link TrackPublication}, participant: {@link Participant})
TrackPublished
Section titled “TrackPublished”TrackPublished: "trackPublished";Defined in: client-sdk-js/src/events.ts:115
A remote participant has published a new track.
args: (publication: {@link RemoteTrackPublication}, participant: {@link RemoteParticipant})
TrackStreamStateChanged
Section titled “TrackStreamStateChanged”TrackStreamStateChanged: "trackStreamStateChanged";Defined in: client-sdk-js/src/events.ts:296
The stream state of a remote track has changed (e.g. the server paused or resumed forwarding media). This is distinct from RoomEvent.TrackMuted which indicates the publisher’s intent.
args: (publication: {@link RemoteTrackPublication}, streamState: {@link StreamState}, participant: {@link RemoteParticipant})
TrackSubscribed
Section titled “TrackSubscribed”TrackSubscribed: "trackSubscribed";Defined in: client-sdk-js/src/events.ts:144
Subscribed to a new track from a remote participant. This is the event where you would typically attach the track to a media element.
args: (track: {@link RemoteTrack}, publication: {@link RemoteTrackPublication}, participant: {@link RemoteParticipant})
TrackSubscriptionFailed
Section titled “TrackSubscriptionFailed”TrackSubscriptionFailed: "trackSubscriptionFailed";Defined in: client-sdk-js/src/events.ts:151
Could not subscribe to a track.
args: (trackSid: string, participant: {@link RemoteParticipant})
TrackUnmuted
Section titled “TrackUnmuted”TrackUnmuted: "trackUnmuted";Defined in: client-sdk-js/src/events.ts:173
A track has been unmuted. Fires on both remote and local participants.
args: (publication: {@link TrackPublication}, participant: {@link Participant})
TrackUnpublished
Section titled “TrackUnpublished”TrackUnpublished: "trackUnpublished";Defined in: client-sdk-js/src/events.ts:122
A remote participant has unpublished a track.
args: (publication: {@link RemoteTrackPublication}, participant: {@link RemoteParticipant})
TrackUnsubscribed
Section titled “TrackUnsubscribed”TrackUnsubscribed: "trackUnsubscribed";Defined in: client-sdk-js/src/events.ts:159
Unsubscribed from a remote track. The track should be detached from any media elements at this point.
args: (track: {@link RemoteTrack}, publication: {@link RemoteTrackPublication}, participant: {@link RemoteParticipant})
VideoPlaybackStatusChanged
Section titled “VideoPlaybackStatusChanged”VideoPlaybackStatusChanged: "videoPlaybackChanged";Defined in: client-sdk-js/src/events.ts:287
Video playback status has changed. Similar to RoomEvent.AudioPlaybackStatusChanged but for video.