RoomEvent
Events that are emitted by a Room instance.
Enumeration Members
ActiveSpeakersChanged
Active speakers changed. List of speakers are ordered by their audio level.
loudest speakers first. This will include the LocalParticipant too.
Speaker updates are sent only to the publishing participant and their subscribers.
Provides: (Participant[])
Value
activeSpeakersChanged
Connected
When the connection to the server has been established
Value
connected
ConnectionQualityChanged
Connection quality was changed for a Participant. It'll receive updates
from the local participant, as well as any RemoteParticipants that we are
subscribed to.
Provides: (connectionQuality: ConnectionQuality, participant: Participant)
Value
connectionQualityChanged
ConnectionStateChanged
Whenever the connection state of the room changes
Provides: (ConnectionState)
Value
connectionStateChanged
DCBufferStatusChanged
Emits whenever the current buffer status of a data channel changes
Provides: (isLow: boolean, kind: DataPacket_Kind)
Value
dcBufferStatusChanged
DataReceived
Data received from another participant.
Data packets provides the ability to use LiveKit to send/receive arbitrary payloads.
All participants in the room will receive the messages sent to the room.
Provides: (payload: Uint8Array, participant: Participant, kind:DataPacket_Kind, topic?: string)
Value
dataReceived
Disconnected
When disconnected from room. This fires when room.disconnect() is called or
when an unrecoverable connection issue had occured
Value
disconnected
LocalAudioSilenceDetected
When a local audio track is published the SDK checks whether there is complete silence
on that track and emits the LocalAudioSilenceDetected event in that case.
This allows for applications to show UI informing users that they might have to
reset their audio hardware or check for proper device connectivity.
Value
localAudioSilenceDetected
LocalTrackPublished
A local track was published successfully. This event is helpful to know
when to update your local UI with the newly published track.
Provides: (LocalTrackPublication, LocalParticipant)
Value
localTrackPublished
LocalTrackUnpublished
A local track was unpublished. This event is helpful to know when to remove
the local track from your UI.
When a user stops sharing their screen by pressing "End" on the browser UI,
this event will also fire.
Provides: (LocalTrackPublication,LocalParticipant)
Value
localTrackUnpublished
MediaDevicesChanged
When input or output devices on the machine have changed.
Value
mediaDevicesChanged
MediaDevicesError
When we have encountered an error while attempting to create a track.
The errors take place in getUserMedia().
Use MediaDeviceFailure.getFailure(error) to get the reason of failure.
LocalParticipant.lastCameraError and LocalParticipant.lastMicrophoneError
will indicate if it had an error while creating the audio or video track respectively.
Provides: (error: Error)
Value
mediaDevicesError
ParticipantConnected
When a RemoteParticipant joins after the local
participant. It will not emit events for participants that are already
in the room
Provides: (RemoteParticipant)
Value
participantConnected
ParticipantDisconnected
When a RemoteParticipant leaves after the local
participant has joined.
Provides: (RemoteParticipant)
Value
participantDisconnected
ParticipantMetadataChanged
Participant metadata is a simple way for app-specific state to be pushed to
all users.
When RoomService.UpdateParticipantMetadata is called to change a participant's
state, all participants in the room will fire this event.
Provides: (prevMetadata: string, Participant)
Value
participantMetadataChanged
ParticipantNameChanged
ParticipantPermissionsChanged
A participant's permission has changed. Currently only fired on LocalParticipant.
Provides: (prevPermissions: ParticipantPermission, participant: Participant)
Value
participantPermissionsChanged
Reconnected
Fires when a reconnection has been successful.
Value
reconnected
Reconnecting
When the connection to the server has been interrupted and it's attempting
to reconnect.
Value
reconnecting
RecordingStatusChanged
Recording of a room has started/stopped. Room.isRecording will be updated too.
Provides: (isRecording: boolean)
Value
recordingStatusChanged
RoomMetadataChanged
Room metadata is a simple way for app-specific state to be pushed to
all users.
When RoomService.UpdateRoomMetadata is called to change a room's state,
all participants in the room will fire this event.
Provides: (string)
Value
roomMetadataChanged
TrackMuted
A track that was muted, fires on both RemoteParticipants andLocalParticipant
Provides: (TrackPublication, Participant)
Value
trackMuted
TrackPublished
When a new track is published to room after the local
participant has joined. It will not fire for tracks that are already published.
A track published doesn't mean the participant has subscribed to it. It's
simply reflecting the state of the room.
Provides: (RemoteTrackPublication, RemoteParticipant)
Value
trackPublished
TrackStreamStateChanged
StreamState indicates if a subscribed (remote) track has been paused by the SFU
(typically this happens because of subscriber's bandwidth constraints)
When bandwidth conditions allow, the track will be resumed automatically.
TrackStreamStateChanged will also be emitted when that happens.
Provides: (pub: RemoteTrackPublication, streamState: Track.StreamState,
participant: RemoteParticipant)
Value
trackStreamStateChanged
TrackSubscribed
TheLocalParticipant has subscribed to a new track. This event will always
fire as long as new tracks are ready for use.
Value
trackSubscribed
TrackSubscriptionFailed
TrackSubscriptionPermissionChanged
One of subscribed tracks have changed its permissions for the current
participant. If permission was revoked, then the track will no longer
be subscribed. If permission was granted, a TrackSubscribed event will
be emitted.
Provides: (pub: RemoteTrackPublication,
status: TrackPublication.SubscriptionStatus,
participant: RemoteParticipant)
Value
trackSubscriptionPermissionChanged
TrackSubscriptionStatusChanged
One of subscribed tracks have changed its status for the current
participant.
Provides: (pub: RemoteTrackPublication,
status: TrackPublication.SubscriptionStatus,
participant: RemoteParticipant)
Value
trackSubscriptionStatusChanged
TrackUnmuted
A track that was unmuted, fires on both RemoteParticipants andLocalParticipant
Provides: (TrackPublication, Participant)
Value
trackUnmuted
TrackUnpublished
A RemoteParticipant has unpublished a track
Provides: (RemoteTrackPublication, RemoteParticipant)
Value
trackUnpublished
TrackUnsubscribed
A subscribed track is no longer available. Clients should listen to this
event and ensure they detach tracks.
Value
trackUnsubscribed