Triggered by a call to room.switchActiveDevice args: (kind: MediaDeviceKind, deviceId: string)
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.
args: (Array<[[Participant]]>)
LiveKit will attempt to autoplay all audio tracks when you attach them to
audio elements. However, if that fails, we'll notify you via AudioPlaybackStatusChanged.
Room.canPlaybackAudio
will indicate if audio playback is permitted.
When the connection to the server has been established
Connection quality was changed for a Participant. It'll receive updates from the local participant, as well as any [[RemoteParticipant]]s that we are subscribed to.
args: (connectionQuality: [[ConnectionQuality]], participant: [[Participant]])
Whenever the connection state of the room changes
args: ([[ConnectionState]])
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.
args: (payload: Uint8Array, participant: [[Participant]], kind: [[DataPacket_Kind]], topic?: string)
Emits whenever the current buffer status of a data channel changes args: (isLow: boolean, kind: [[DataPacket_Kind]])
When disconnected from room. This fires when room.disconnect() is called or when an unrecoverable connection issue had occured.
DisconnectReason can be used to determine why the participant was disconnected. Notable reasons are
args: ([[DisconnectReason]])
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.
A local track was published successfully. This event is helpful to know when to update your local UI with the newly published track.
args: ([[LocalTrackPublication]], [[LocalParticipant]])
fired when the first remote participant has subscribed to the localParticipant's track
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.
args: ([[LocalTrackPublication]], [[LocalParticipant]])
When input or output devices on the machine have changed.
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.
args: (error: Error)
fired when the client receives connection metrics from other participants
Participant attributes is an app-specific key value state to be pushed to all users. When a participant's attributes changed, this event will be emitted with the changed attributes and the participant args: (changedAttributes: [[Record<string, string]], participant: [[Participant]])
When a [[RemoteParticipant]] joins after the local participant. It will not emit events for participants that are already in the room
args: ([[RemoteParticipant]])
When a [[RemoteParticipant]] leaves after the local participant has joined.
args: ([[RemoteParticipant]])
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.
args: (prevMetadata: string, [[Participant]])
Participant's display name changed
args: (name: string, [[Participant]])
A participant's permission has changed. args: (prevPermissions: [[ParticipantPermission]], participant: [[Participant]])
Fires when a reconnection has been successful.
When the connection to the server has been interrupted and it's attempting to reconnect.
Recording of a room has started/stopped. Room.isRecording will be updated too. args: (isRecording: boolean)
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.
args: (string)
Signal connected, can publish tracks.
When the signal connection to the server has been interrupted. This isn't noticeable to users most of the time.
It will resolve with a RoomEvent.Reconnected
once the signal connection has been re-established.
If media fails additionally it an additional RoomEvent.Reconnecting
will be emitted.
SIP DTMF tones received from another participant.
args: (participant: [[Participant]], dtmf: [[DataPacket_Kind]])
A track that was muted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
args: ([[TrackPublication]], [[Participant]])
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.
args: ([[RemoteTrackPublication]], [[RemoteParticipant]])
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.
args: (pub: [[RemoteTrackPublication]], streamState: [[Track.StreamState]], participant: [[RemoteParticipant]])
The [[LocalParticipant]] has subscribed to a new track. This event will always fire as long as new tracks are ready for use.
args: ([[RemoteTrack]], [[RemoteTrackPublication]], [[RemoteParticipant]])
Could not subscribe to a track
args: (track sid, [[RemoteParticipant]])
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.
args: (pub: [[RemoteTrackPublication]], status: [[TrackPublication.PermissionStatus]], participant: [[RemoteParticipant]])
One of subscribed tracks have changed its status for the current participant.
args: (pub: [[RemoteTrackPublication]], status: [[TrackPublication.SubscriptionStatus]], participant: [[RemoteParticipant]])
A track that was unmuted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
args: ([[TrackPublication]], [[Participant]])
A [[RemoteParticipant]] has unpublished a track
args: ([[RemoteTrackPublication]], [[RemoteParticipant]])
A subscribed track is no longer available. Clients should listen to this event and ensure they detach tracks.
args: ([[Track]], [[RemoteTrackPublication]], [[RemoteParticipant]])
Beta
TranscriptionTranscription received from a participant's track.
LiveKit will attempt to autoplay all video tracks when you attach them to
a video element. However, if that fails, we'll notify you via VideoPlaybackStatusChanged.
Calling room.startVideo()
in a user gesture event handler will resume the video playback.
Events are the primary way LiveKit notifies your application of changes.
The following are events emitted by [[Room]], listen to room events like