Manage Participants in a Session
Use RealtimeKit host controls to manage other participants in a live session. You can mute audio or video, pin a participant, or remove participants from the session. These actions require specific host control permissions enabled in the local participant's Preset. Before you show UI controls or call these methods, verify that the local participant has the necessary permissions. In this guide, the local participant refers to the user performing the actions.
To perform actions on a specific participant, you first need to retrieve their participant object.
Remote participants (other participants) are available in meeting.participants. The local participant is available in meeting.self.
Refer to Meeting Object Explained for details.
const joinedParticipants = meeting.participants.joined.toArray();const participant = joinedParticipants[0];if (!participant) { // No remote participants are currently joined.}To perform actions on a specific participant, you first need to retrieve their participant object.
Remote participants (other participants) are available in meeting.participants. The local participant is available in meeting.self.
Refer to Meeting Object Explained for details.
const joinedParticipants = meeting.participants.joined.toArray();const participant = joinedParticipants[0];if (!participant) { // No remote participants are currently joined.}To perform actions on a specific participant, you first need to retrieve their participant object.
Remote participants (other participants) are available in meeting.participants. The local participant is available in meeting.self.
Refer to Meeting Object Explained for details.
const joinedParticipants = meeting.participants.joined.toArray();const participant = joinedParticipants[0];if (!participant) { // No remote participants are currently joined.}To perform actions on a specific participant, retrieve their participant object from the participants property.
Remote participants are available in meeting.participants.joined. The local participant is available in meeting.localUser.
val joinedParticipants = meeting.participants.joinedval participant = joinedParticipants.firstOrNull()if (participant == null) { // No remote participants are currently joined.}To perform actions on a specific participant, retrieve their participant object from the participants property.
Remote participants are available in meeting.participants.joined. The local participant is available in meeting.localUser.
let joinedParticipants = meeting.participants.joinedguard let participant = joinedParticipants.first else { // No remote participants are currently joined. return}To perform actions on a specific participant, retrieve their participant object from the participants property.
Remote participants are available in meeting.participants.joined. The local participant is available in meeting.localUser.
final joinedParticipants = meeting.participants.joined;final participant = joinedParticipants.firstOrNull;if (participant == null) { // No remote participants are currently joined.}To perform actions on a specific participant, retrieve their participant object from the participants property.
Remote participants are available in meeting.participants.joined. The local participant is available in meeting.self.
const joinedParticipants = meeting.participants.joined;const participant = joinedParticipants.toArray()[0];if (!participant) { // No remote participants are currently joined.}Or use the useRealtimeKitSelector hook:
import { useRealtimeKitSelector } from '@cloudflare/realtimekit-react-native';
const joinedParticipants = useRealtimeKitSelector((m) => m.participants.joined);Mute audio of participants when you need to manage background noise, moderate a classroom or webinar, or prevent interruptions during a session.
This action requires the Mute Audio (disable_participant_audio) host control permission enabled in the local participant's preset.
To mute a specific participant's audio:
-
Check that the local participant has permission to mute other participants' audio.
TypeScript const canMuteAudio =meeting.self.permissions.canDisableParticipantAudio === true;if (!canMuteAudio) {// Disable the control in your UI.} -
Call
disableAudio()on the target participant.If the local participant does not have the required permission,
disableAudio()throws aClientErrorwith code1201.TypeScript try {await participant.disableAudio();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to mute other participants’ audio.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, the target participant's
audioEnabledbecomesfalse, and the SDK emits anaudioUpdateevent.Option A: Listen on the participant object
TypeScript participant.on("audioUpdate", ({ audioEnabled, audioTrack }) => {// audioEnabled is false// Update UI for the participant});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("audioUpdate",(participant, { audioEnabled, audioTrack }) => {if (participant.id === targetParticipantId) {// audioEnabled is false// Update UI for the participant}},);
-
Check that the local participant has permission to mute other participants' audio.
TypeScript const canMuteAudio =meeting.self.permissions.canDisableParticipantAudio === true;if (!canMuteAudio) {// Disable the control in your UI.} -
Call
disableAudio()on the target participant.If the local participant does not have the required permission,
disableAudio()throws aClientErrorwith code1201.TypeScript try {await participant.disableAudio();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to mute other participants’ audio.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, the target participant's
audioEnabledbecomesfalse, and the SDK emits anaudioUpdateevent.Option A: Listen on the participant object
TypeScript participant.on("audioUpdate", ({ audioEnabled, audioTrack }) => {// audioEnabled is false// Update UI for the participant});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("audioUpdate",(participant, { audioEnabled, audioTrack }) => {if (participant.id === targetParticipantId) {// audioEnabled is false// Update UI for the participant}},);
-
Check that the local participant has permission to mute other participants' audio.
TypeScript const canMuteAudio =meeting.self.permissions.canDisableParticipantAudio === true;if (!canMuteAudio) {// Disable the control in your UI.} -
Call
disableAudio()on the target participant.If the local participant does not have the required permission,
disableAudio()throws aClientErrorwith code1201.TypeScript try {await participant.disableAudio();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to mute other participants’ audio.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, the target participant's
audioEnabledbecomesfalse, and the SDK emits anaudioUpdateevent.Option A: Listen on the participant object
TypeScript participant.on("audioUpdate", ({ audioEnabled, audioTrack }) => {// audioEnabled is false// Update UI for the participant});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("audioUpdate",(participant, { audioEnabled, audioTrack }) => {if (participant.id === targetParticipantId) {// audioEnabled is false// Update UI for the participant}},);
- Check that the local participant has permission to mute other participants' audio.
val canMuteAudio = meeting.localUser.permissions.host.canMuteAudioif (!canMuteAudio) { // Disable the control in your UI.}- Call
disableAudio()on the target participant. If the local participant does not have the required permission,disableAudio()returns aHostError.
val error = participant.disableAudio()if (error != null) { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, the target participant's
audioEnabledbecomesfalse.
meeting.addParticipantsEventListener(object : RtkParticipantsEventListener { override fun onAudioUpdate(participant: RtkRemoteParticipant, isEnabled: Boolean) { // audioEnabled is false // Update UI for the participant }})- Check that the local participant has permission to mute other participants' audio.
let canMuteAudio = meeting.localUser.permissions.host.canMuteAudioif !canMuteAudio { // Disable the control in your UI.}- Call
disableAudio()on the target participant. If the local participant does not have the required permission,disableAudio()returns aHostError.
if let error = participant.disableAudio() { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, the target participant's
audioEnabledbecomesfalse.
extension MeetingViewModel: RtkParticipantsEventListener { func onAudioUpdate(participant: RtkRemoteParticipant, isEnabled: Bool) { // audioEnabled is false // Update UI for the participant }}
// Register the listenermeeting.addParticipantsEventListener(participantsEventListener: self)- Check that the local participant has permission to mute other participants' audio.
final canMuteAudio = meeting.localUser.permissions.host.canMuteAudio;if (!canMuteAudio) { // Disable the control in your UI.}- Call
disableAudio()on the target participant.
participant.disableAudio( onResult: (error) { if (error != null) { // Handle error - permission denied or other issue. return; } // Audio disabled successfully. },);- Handle the result by listening for updates. After the call succeeds, the target participant's
audioEnabledbecomesfalse.
class ParticipantsEventsListener extends RtkParticipantsEventListener { @override void onAudioUpdate(RtkRemoteParticipant participant, bool isEnabled) { // audioEnabled is false // Update UI for the participant }}
// Register the listenermeeting.addParticipantsEventListener(ParticipantsEventsListener());- Check that the local participant has permission to mute other participants' audio.
const canDisableParticipantAudio = meeting.self.permissions.canDisableParticipantAudio;if (!canDisableParticipantAudio) { // Disable the control in your UI.}- Call
disableAudio()on the target participant.
participant .disableAudio() .catch((err) => { // Handle error - permission denied or other issue. console.log(err); });- Handle the result by listening for updates. After the call succeeds, the target participant's
audioEnabledbecomesfalse.
meeting.participants.joined.on('audioUpdate', (participant) => { // participant.audioEnabled is false // Update UI for the participant});This affects all participants, including the local participant. To mute audio for all participants in the session:
-
Check that the local participant has permission to mute other participants' audio.
TypeScript const canMuteAudio =meeting.self.permissions.canDisableParticipantAudio === true;if (!canMuteAudio) {// Disable the control in your UI.} -
Call
disableAllAudio().If the local participant does not have the required permission,
disableAllAudio()throws aClientErrorwith code1201.TypeScript try {await meeting.participants.disableAllAudio();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to mute other participants’ audio.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, each participant’s
audioEnabledbecomesfalse, and the SDK emits anaudioUpdateevent. The local participant also receivesaudioUpdateonmeeting.self.Listen to remote participant updates on the
joinedmap:TypeScript meeting.participants.joined.on("audioUpdate",(participant, { audioEnabled, audioTrack }) => {// audioEnabled is false// Update UI for the participant},);Listen to the local participant update on
meeting.self:TypeScript meeting.self.on("audioUpdate", ({ audioEnabled, audioTrack }) => {// audioEnabled is false// Update UI for the local participant});
-
Check that the local participant has permission to mute other participants' audio.
TypeScript const canMuteAudio =meeting.self.permissions.canDisableParticipantAudio === true;if (!canMuteAudio) {// Disable the control in your UI.} -
Call
disableAllAudio().If the local participant does not have the required permission,
disableAllAudio()throws aClientErrorwith code1201.TypeScript try {await meeting.participants.disableAllAudio();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to mute other participants’ audio.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, each participant’s
audioEnabledbecomesfalse, and the SDK emits anaudioUpdateevent. The local participant also receivesaudioUpdateonmeeting.self.Listen to remote participant updates on the
joinedmap:TypeScript meeting.participants.joined.on("audioUpdate",(participant, { audioEnabled, audioTrack }) => {// audioEnabled is false// Update UI for the participant},);Listen to the local participant update on
meeting.self:TypeScript meeting.self.on("audioUpdate", ({ audioEnabled, audioTrack }) => {// audioEnabled is false// Update UI for the local participant});
-
Check that the local participant has permission to mute other participants' audio.
TypeScript const canMuteAudio =meeting.self.permissions.canDisableParticipantAudio === true;if (!canMuteAudio) {// Disable the control in your UI.} -
Call
disableAllAudio().If the local participant does not have the required permission,
disableAllAudio()throws aClientErrorwith code1201.TypeScript try {await meeting.participants.disableAllAudio();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to mute other participants’ audio.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, each participant’s
audioEnabledbecomesfalse, and the SDK emits anaudioUpdateevent. The local participant also receivesaudioUpdateonmeeting.self.Listen to remote participant updates on the
joinedmap:TypeScript meeting.participants.joined.on("audioUpdate",(participant, { audioEnabled, audioTrack }) => {// audioEnabled is false// Update UI for the participant},);Listen to the local participant update on
meeting.self:TypeScript meeting.self.on("audioUpdate", ({ audioEnabled, audioTrack }) => {// audioEnabled is false// Update UI for the local participant});
- Check that the local participant has permission to mute other participants' audio.
val canMuteAudio = meeting.localUser.permissions.host.canMuteAudioif (!canMuteAudio) { // Disable the control in your UI.}- Call
disableAllAudio()on the participants object. If the local participant does not have the required permission,disableAllAudio()returns aHostError.
val error = meeting.participants.disableAllAudio()if (error != null) { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, each participant's
audioEnabledbecomesfalse.
meeting.addParticipantsEventListener(object : RtkParticipantsEventListener { override fun onAudioUpdate(participant: RtkRemoteParticipant, isEnabled: Boolean) { // audioEnabled is false // Update UI for the participant }})- Check that the local participant has permission to mute other participants' audio.
let canMuteAudio = meeting.localUser.permissions.host.canMuteAudioif !canMuteAudio { // Disable the control in your UI.}- Call
disableAllAudio()on the participants object. If the local participant does not have the required permission,disableAllAudio()returns aHostError.
if let error = meeting.participants.disableAllAudio() { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, each participant's
audioEnabledbecomesfalse.
extension MeetingViewModel: RtkParticipantsEventListener { func onAudioUpdate(participant: RtkRemoteParticipant, isEnabled: Bool) { // audioEnabled is false // Update UI for the participant }}
// Register the listenermeeting.addParticipantsEventListener(participantsEventListener: self)- Check that the local participant has permission to mute other participants' audio.
final canMuteAudio = meeting.localUser.permissions.host.canMuteAudio;if (!canMuteAudio) { // Disable the control in your UI.}- Call
disableAllAudio()on the participants object.
meeting.participants.disableAllAudio( onResult: (error) { if (error != null) { // Handle error - permission denied or other issue. return; } // All audio disabled successfully. },);- Handle the result by listening for updates. After the call succeeds, each participant's
audioEnabledbecomesfalse.
class ParticipantsEventsListener extends RtkParticipantsEventListener { @override void onAudioUpdate(RtkRemoteParticipant participant, bool isEnabled) { // audioEnabled is false // Update UI for the participant }}
// Register the listenermeeting.addParticipantsEventListener(ParticipantsEventsListener());- Check that the local participant has permission to mute other participants' audio.
const canDisableParticipantAudio = meeting.self.permissions.canDisableParticipantAudio;if (!canDisableParticipantAudio) { // Disable the control in your UI.}- Call
disableAllAudio()on the participants object.
meeting.participants .disableAllAudio(true) .catch((err) => { // Handle error - permission denied or other issue. console.log(err); });- Handle the result by listening for updates. After the call succeeds, each participant's
audioEnabledbecomesfalse.
meeting.participants.joined.on('audioUpdate', (participant) => { // participant.audioEnabled is false // Update UI for the participant});Disable video of participants when you need to moderate a session, enforce privacy, or prevent unwanted video during a classroom or webinar.
This action requires the Mute Video (disable_participant_video) host control permission enabled in the local participant's preset.
To disable a specific participant's video:
-
Check that the local participant has permission to disable other participants' video.
TypeScript const canDisableVideo =meeting.self.permissions.canDisableParticipantVideo === true;if (!canDisableVideo) {// Disable the control in your UI.} -
Call
disableVideo()on the target participant.If the local participant does not have the required permission,
disableVideo()throws aClientErrorwith code1201.TypeScript try {await participant.disableVideo();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to disable other participants’ video.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, the target participant's
videoEnabledbecomesfalse, and the SDK emits avideoUpdateevent.Option A: Listen on the participant object
TypeScript participant.on("videoUpdate", ({ videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the participant});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("videoUpdate",(participant, { videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the participant},);
-
Check that the local participant has permission to disable other participants' video.
TypeScript const canDisableVideo =meeting.self.permissions.canDisableParticipantVideo === true;if (!canDisableVideo) {// Disable the control in your UI.} -
Call
disableVideo()on the target participant.If the local participant does not have the required permission,
disableVideo()throws aClientErrorwith code1201.TypeScript try {await participant.disableVideo();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to disable other participants’ video.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, the target participant's
videoEnabledbecomesfalse, and the SDK emits avideoUpdateevent.Option A: Listen on the participant object
TypeScript participant.on("videoUpdate", ({ videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the participant});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("videoUpdate",(participant, { videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the participant},);
-
Check that the local participant has permission to disable other participants' video.
TypeScript const canDisableVideo =meeting.self.permissions.canDisableParticipantVideo === true;if (!canDisableVideo) {// Disable the control in your UI.} -
Call
disableVideo()on the target participant.If the local participant does not have the required permission,
disableVideo()throws aClientErrorwith code1201.TypeScript try {await participant.disableVideo();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to disable other participants’ video.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, the target participant's
videoEnabledbecomesfalse, and the SDK emits avideoUpdateevent.Option A: Listen on the participant object
TypeScript participant.on("videoUpdate", ({ videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the participant});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("videoUpdate",(participant, { videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the participant},);
- Check that the local participant has permission to disable other participants' video.
val canMuteVideo = meeting.localUser.permissions.host.canMuteVideoif (!canMuteVideo) { // Disable the control in your UI.}- Call
disableVideo()on the target participant. If the local participant does not have the required permission,disableVideo()returns aHostError.
val error = participant.disableVideo()if (error != null) { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, the target participant's
videoEnabledbecomesfalse.
meeting.addParticipantsEventListener(object : RtkParticipantsEventListener { override fun onVideoUpdate(participant: RtkRemoteParticipant, isEnabled: Boolean) { // videoEnabled is false // Update UI for the participant }})- Check that the local participant has permission to disable other participants' video.
let canMuteVideo = meeting.localUser.permissions.host.canMuteVideoif !canMuteVideo { // Disable the control in your UI.}- Call
disableVideo()on the target participant. If the local participant does not have the required permission,disableVideo()returns aHostError.
if let error = participant.disableVideo() { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, the target participant's
videoEnabledbecomesfalse.
extension MeetingViewModel: RtkParticipantsEventListener { func onVideoUpdate(participant: RtkRemoteParticipant, isEnabled: Bool) { // videoEnabled is false // Update UI for the participant }}
// Register the listenermeeting.addParticipantsEventListener(participantsEventListener: self)- Check that the local participant has permission to disable other participants' video.
final canMuteVideo = meeting.localUser.permissions.host.canMuteVideo;if (!canMuteVideo) { // Disable the control in your UI.}- Call
disableVideo()on the target participant.
participant.disableVideo( onResult: (error) { if (error != null) { // Handle error - permission denied or other issue. return; } // Video disabled successfully. },);- Handle the result by listening for updates. After the call succeeds, the target participant's
videoEnabledbecomesfalse.
class ParticipantsEventsListener extends RtkParticipantsEventListener { @override void onVideoUpdate(RtkRemoteParticipant participant, bool isEnabled) { // videoEnabled is false // Update UI for the participant }}
// Register the listenermeeting.addParticipantsEventListener(ParticipantsEventsListener());- Check that the local participant has permission to disable other participants' video.
const canDisableParticipantVideo = meeting.self.permissions.canDisableParticipantVideo;if (!canDisableParticipantVideo) { // Disable the control in your UI.}- Call
disableVideo()on the target participant.
participant .disableVideo() .catch((err) => { // Handle error - permission denied or other issue. console.log(err); });- Handle the result by listening for updates. After the call succeeds, the target participant's
videoEnabledbecomesfalse.
meeting.participants.joined.on('videoUpdate', (participant) => { // participant.videoEnabled is false // Update UI for the participant});This affects all participants, including the local participant. To disable video for all participants in the session:
-
Check that the local participant has permission to disable other participants' video.
TypeScript const canDisableVideo =meeting.self.permissions.canDisableParticipantVideo === true;if (!canDisableVideo) {// Disable the control in your UI.} -
Call
disableAllVideo().If the local participant does not have the required permission,
disableAllVideo()throws aClientErrorwith code1201.TypeScript try {await meeting.participants.disableAllVideo();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to disable other participants’ video.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, each participant’s
videoEnabledbecomesfalse, and the SDK emits avideoUpdateevent. The local participant also receivesvideoUpdateonmeeting.self.Listen to remote participant updates on the
joinedmap:TypeScript meeting.participants.joined.on("videoUpdate",(participant, { videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the participant},);Listen to local participant update on
meeting.self:TypeScript meeting.self.on("videoUpdate", ({ videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the local participant});
-
Check that the local participant has permission to disable other participants' video.
TypeScript const canDisableVideo =meeting.self.permissions.canDisableParticipantVideo === true;if (!canDisableVideo) {// Disable the control in your UI.} -
Call
disableAllVideo().If the local participant does not have the required permission,
disableAllVideo()throws aClientErrorwith code1201.TypeScript try {await meeting.participants.disableAllVideo();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to disable other participants’ video.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, each participant’s
videoEnabledbecomesfalse, and the SDK emits avideoUpdateevent. The local participant also receivesvideoUpdateonmeeting.self.Listen to remote participant updates on the
joinedmap:TypeScript meeting.participants.joined.on("videoUpdate",(participant, { videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the participant},);Listen to local participant update on
meeting.self:TypeScript meeting.self.on("videoUpdate", ({ videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the local participant});
-
Check that the local participant has permission to disable other participants' video.
TypeScript const canDisableVideo =meeting.self.permissions.canDisableParticipantVideo === true;if (!canDisableVideo) {// Disable the control in your UI.} -
Call
disableAllVideo().If the local participant does not have the required permission,
disableAllVideo()throws aClientErrorwith code1201.TypeScript try {await meeting.participants.disableAllVideo();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to disable other participants’ video.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, each participant’s
videoEnabledbecomesfalse, and the SDK emits avideoUpdateevent. The local participant also receivesvideoUpdateonmeeting.self.Listen to remote participant updates on the
joinedmap:TypeScript meeting.participants.joined.on("videoUpdate",(participant, { videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the participant},);Listen to local participant update on
meeting.self:TypeScript meeting.self.on("videoUpdate", ({ videoEnabled, videoTrack }) => {// videoEnabled is false// Update UI for the local participant});
- Check that the local participant has permission to disable other participants' video.
val canMuteVideo = meeting.localUser.permissions.host.canMuteVideoif (!canMuteVideo) { // Disable the control in your UI.}- Call
disableAllVideo()on the participants object. If the local participant does not have the required permission,disableAllVideo()returns aHostError.
val error = meeting.participants.disableAllVideo()if (error != null) { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, each participant's
videoEnabledbecomesfalse.
meeting.addParticipantsEventListener(object : RtkParticipantsEventListener { override fun onVideoUpdate(participant: RtkRemoteParticipant, isEnabled: Boolean) { // videoEnabled is false // Update UI for the participant }})- Check that the local participant has permission to disable other participants' video.
let canMuteVideo = meeting.localUser.permissions.host.canMuteVideoif !canMuteVideo { // Disable the control in your UI.}- Call
disableAllVideo()on the participants object. If the local participant does not have the required permission,disableAllVideo()returns aHostError.
if let error = meeting.participants.disableAllVideo() { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, each participant's
videoEnabledbecomesfalse.
extension MeetingViewModel: RtkParticipantsEventListener { func onVideoUpdate(participant: RtkRemoteParticipant, isEnabled: Bool) { // videoEnabled is false // Update UI for the participant }}
// Register the listenermeeting.addParticipantsEventListener(participantsEventListener: self)- Check that the local participant has permission to disable other participants' video.
final canMuteVideo = meeting.localUser.permissions.host.canMuteVideo;if (!canMuteVideo) { // Disable the control in your UI.}- Call
disableAllVideo()on the participants object.
meeting.participants.disableAllVideo( onResult: (error) { if (error != null) { // Handle error - permission denied or other issue. return; } // All video disabled successfully. },);- Handle the result by listening for updates. After the call succeeds, each participant's
videoEnabledbecomesfalse.
class ParticipantsEventsListener extends RtkParticipantsEventListener { @override void onVideoUpdate(RtkRemoteParticipant participant, bool isEnabled) { // videoEnabled is false // Update UI for the participant }}
// Register the listenermeeting.addParticipantsEventListener(ParticipantsEventsListener());- Check that the local participant has permission to disable other participants' video.
const canDisableParticipantVideo = meeting.self.permissions.canDisableParticipantVideo;if (!canDisableParticipantVideo) { // Disable the control in your UI.}- Call
disableAllVideo()on the participants object.
meeting.participants .disableAllVideo(true) .catch((err) => { // Handle error - permission denied or other issue. console.log(err); });- Handle the result by listening for updates. After the call succeeds, each participant's
videoEnabledbecomesfalse.
meeting.participants.joined.on('videoUpdate', (participant) => { // participant.videoEnabled is false // Update UI for the participant});Pin a participant to highlight them, such as a webinar presenter or classroom teacher. This is a session-wide action. All participants will see the pinned participant as the focus.
This action requires the Pin Participant (pin_participant) host control permission enabled in the local participant's preset.
To pin a participant in a session:
-
Check that the local participant has permission to pin participants.
TypeScript const canPinParticipant = meeting.self.permissions.pinParticipant === true;if (!canPinParticipant) {// Disable the control in your UI.} -
Call
pin()on the target participant.If the local participant does not have the required permission,
pin()throws aClientErrorwith code1201.TypeScript try {await participant.pin();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to pin participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds:
- The target participant's
isPinnedbecomes true. - The participant is added to
meeting.participants.pinned. - The SDK emits a
pinnedevent.
Option A: Listen on the participant object
TypeScript participant.on("pinned", (updatedParticipant) => {// updatedParticipant.isPinned is true// Update your UI.});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("pinned", (updatedParticipant) => {// updatedParticipant.isPinned is true// Update your UI.});If there was an existing pinned participant before, then the SDK emits an
unpinnedevent for that participant. - The target participant's
-
On the target pinned participant's side,
meeting.self.isPinnedbecomestrueandmeeting.selfemitspinned:TypeScript meeting.self.on("pinned", (selfParticipant) => {// Update the local UI to indicate the participant is pinned.});
-
Check that the local participant has permission to pin participants.
TypeScript const canPinParticipant = meeting.self.permissions.pinParticipant === true;if (!canPinParticipant) {// Disable the control in your UI.} -
Call
pin()on the target participant.If the local participant does not have the required permission,
pin()throws aClientErrorwith code1201.TypeScript try {await participant.pin();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to pin participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds:
- The target participant's
isPinnedbecomes true. - The participant is added to
meeting.participants.pinned. - The SDK emits a
pinnedevent.
Option A: Listen on the participant object
TypeScript participant.on("pinned", (updatedParticipant) => {// updatedParticipant.isPinned is true// Update your UI.});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("pinned", (updatedParticipant) => {// updatedParticipant.isPinned is true// Update your UI.});If there was an existing pinned participant before, then the SDK emits an
unpinnedevent for that participant. - The target participant's
-
On the target pinned participant's side,
meeting.self.isPinnedbecomestrueandmeeting.selfemitspinned:TypeScript meeting.self.on("pinned", (selfParticipant) => {// Update the local UI to indicate the participant is pinned.});
-
Check that the local participant has permission to pin participants.
TypeScript const canPinParticipant = meeting.self.permissions.pinParticipant === true;if (!canPinParticipant) {// Disable the control in your UI.} -
Call
pin()on the target participant.If the local participant does not have the required permission,
pin()throws aClientErrorwith code1201.TypeScript try {await participant.pin();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to pin participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds:
- The target participant's
isPinnedbecomes true. - The participant is added to
meeting.participants.pinned. - The SDK emits a
pinnedevent.
Option A: Listen on the participant object
TypeScript participant.on("pinned", (updatedParticipant) => {// updatedParticipant.isPinned is true// Update your UI.});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("pinned", (updatedParticipant) => {// updatedParticipant.isPinned is true// Update your UI.});If there was an existing pinned participant before, then the SDK emits an
unpinnedevent for that participant. - The target participant's
-
On the target pinned participant's side,
meeting.self.isPinnedbecomestrueandmeeting.selfemitspinned:TypeScript meeting.self.on("pinned", (selfParticipant) => {// Update the local UI to indicate the participant is pinned.});
- Check that the local participant has permission to pin participants.
val canPinParticipant = meeting.localUser.permissions.host.canPinParticipantif (!canPinParticipant) { // Disable the control in your UI.}- Call
pin()on the target participant. If the local participant does not have the required permission,pin()returns aHostError.
val error = participant.pin()if (error != null) { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, the target participant's
isPinnedbecomestrueand the participant is available inmeeting.participants.pinned.
meeting.addParticipantsEventListener(object : RtkParticipantsEventListener { override fun onParticipantPinned(participant: RtkRemoteParticipant) { // participant.isPinned is true // Update your UI. }})- Check that the local participant has permission to pin participants.
let canPinParticipant = meeting.localUser.permissions.host.canPinParticipantif !canPinParticipant { // Disable the control in your UI.}- Call
pin()on the target participant. If the local participant does not have the required permission,pin()returns aHostError.
if let error = participant.pin() { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, the target participant's
isPinnedbecomestrueand the participant is available inmeeting.participants.pinned.
extension MeetingViewModel: RtkParticipantsEventListener { func onParticipantPinned(participant: RtkRemoteParticipant) { // participant.isPinned is true // Update your UI. }}
// Register the listenermeeting.addParticipantsEventListener(participantsEventListener: self)- Check that the local participant has permission to pin participants.
final canPinParticipant = meeting.localUser.permissions.host.canPinParticipant;if (!canPinParticipant) { // Disable the control in your UI.}- Call
pin()on the target participant.
participant.pin();- Handle the result by listening for updates. After the call succeeds, the target participant's
isPinnedbecomestrueand the participant is available inmeeting.participants.pinned.
class ParticipantsEventsListener extends RtkParticipantsEventListener { @override void onParticipantPinned(RtkRemoteParticipant participant) { // participant.isPinned is true // Update your UI. }}
// Register the listenermeeting.addParticipantsEventListener(ParticipantsEventsListener());- Check that the local participant has permission to pin participants.
const canPinParticipant = meeting.self.permissions.pinParticipant;if (!canPinParticipant) { // Disable the control in your UI.}- Call
pin()on the target participant.
participant.pin();- Handle the result by listening for updates. After the call succeeds, the target participant's
isPinnedbecomestrueand the participant is available inmeeting.participants.pinned.
meeting.participants.pinned.on('participantPinned', (participant) => { // participant.isPinned is true // Update your UI.});Unpin a participant when you need to undo the highlight and return the session to a standard grid or active speaker view. To unpin a pinned participant in a session:
-
Check that the local participant has permission to unpin participants.
TypeScript const canUnpinParticipant = meeting.self.permissions.pinParticipant === true;if (!canUnpinParticipant) {// Disable the control in your UI.} -
Call
unpin()on the target participant.If the local participant does not have the required permission,
unpin()throws aClientErrorwith code1201.TypeScript try {await participant.unpin();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to unpin participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds:
- The target participant's
isPinnedbecomesfalse. - The participant is removed from
meeting.participants.pinned. - The SDK emits an
unpinnedevent.
Option A: Listen on the participant object
TypeScript participant.on("unpinned", (updatedParticipant) => {// updatedParticipant.isPinned is false// Update your UI.});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("unpinned", (updatedParticipant) => {// updatedParticipant.isPinned is false// Update your UI.}); - The target participant's
-
On the target unpinned participant's side,
meeting.self.isPinnedbecomesfalseandmeeting.selfemitsunpinned:TypeScript meeting.self.on("unpinned", (selfParticipant) => {// Update the local UI to indicate the participant is no longer pinned.});
-
Check that the local participant has permission to unpin participants.
TypeScript const canUnpinParticipant = meeting.self.permissions.pinParticipant === true;if (!canUnpinParticipant) {// Disable the control in your UI.} -
Call
unpin()on the target participant.If the local participant does not have the required permission,
unpin()throws aClientErrorwith code1201.TypeScript try {await participant.unpin();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to unpin participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds:
- The target participant's
isPinnedbecomesfalse. - The participant is removed from
meeting.participants.pinned. - The SDK emits an
unpinnedevent.
Option A: Listen on the participant object
TypeScript participant.on("unpinned", (updatedParticipant) => {// updatedParticipant.isPinned is false// Update your UI.});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("unpinned", (updatedParticipant) => {// updatedParticipant.isPinned is false// Update your UI.}); - The target participant's
-
On the target unpinned participant's side,
meeting.self.isPinnedbecomesfalseandmeeting.selfemitsunpinned:TypeScript meeting.self.on("unpinned", (selfParticipant) => {// Update the local UI to indicate the participant is no longer pinned.});
-
Check that the local participant has permission to unpin participants.
TypeScript const canUnpinParticipant = meeting.self.permissions.pinParticipant === true;if (!canUnpinParticipant) {// Disable the control in your UI.} -
Call
unpin()on the target participant.If the local participant does not have the required permission,
unpin()throws aClientErrorwith code1201.TypeScript try {await participant.unpin();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to unpin participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds:
- The target participant's
isPinnedbecomesfalse. - The participant is removed from
meeting.participants.pinned. - The SDK emits an
unpinnedevent.
Option A: Listen on the participant object
TypeScript participant.on("unpinned", (updatedParticipant) => {// updatedParticipant.isPinned is false// Update your UI.});Option B: Listen on the
joinedmapTypeScript meeting.participants.joined.on("unpinned", (updatedParticipant) => {// updatedParticipant.isPinned is false// Update your UI.}); - The target participant's
-
On the target unpinned participant's side,
meeting.self.isPinnedbecomesfalseandmeeting.selfemitsunpinned:TypeScript meeting.self.on("unpinned", (selfParticipant) => {// Update the local UI to indicate the participant is no longer pinned.});
- Check that the local participant has permission to unpin participants.
val canPinParticipant = meeting.localUser.permissions.host.canPinParticipantif (!canPinParticipant) { // Disable the control in your UI.}- Call
unpin()on the target participant. If the local participant does not have the required permission,unpin()returns aHostError.
val error = participant.unpin()if (error != null) { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, the target participant's
isPinnedbecomesfalse.
meeting.addParticipantsEventListener(object : RtkParticipantsEventListener { override fun onParticipantUnpinned(participant: RtkRemoteParticipant) { // participant.isPinned is false // Update your UI. }})- Check that the local participant has permission to unpin participants.
let canPinParticipant = meeting.localUser.permissions.host.canPinParticipantif !canPinParticipant { // Disable the control in your UI.}- Call
unpin()on the target participant. If the local participant does not have the required permission,unpin()returns aHostError.
if let error = participant.unpin() { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, the target participant's
isPinnedbecomesfalse.
extension MeetingViewModel: RtkParticipantsEventListener { func onParticipantUnpinned(participant: RtkRemoteParticipant) { // participant.isPinned is false // Update your UI. }}
// Register the listenermeeting.addParticipantsEventListener(participantsEventListener: self)- Check that the local participant has permission to unpin participants.
final canPinParticipant = meeting.localUser.permissions.host.canPinParticipant;if (!canPinParticipant) { // Disable the control in your UI.}- Call
unpin()on the target participant.
participant.unpin();- Handle the result by listening for updates. After the call succeeds, the target participant's
isPinnedbecomesfalse.
class ParticipantsEventsListener extends RtkParticipantsEventListener { @override void onParticipantUnpinned(RtkRemoteParticipant participant) { // participant.isPinned is false // Update your UI. }}
// Register the listenermeeting.addParticipantsEventListener(ParticipantsEventsListener());- Check that the local participant has permission to unpin participants.
const canPinParticipant = meeting.self.permissions.pinParticipant;if (!canPinParticipant) { // Disable the control in your UI.}- Call
unpin()on the target participant.
participant.unpin();- Handle the result by listening for updates. After the call succeeds, the target participant's
isPinnedbecomesfalse.
meeting.participants.pinned.on('unpinned', (participant) => { // participant.isPinned is false // Update your UI.});Remove participants from the session when you need to moderate disruptive behavior or enforce session rules.
This action requires the Kick Participants (kick_participant) host control permission enabled in the local participant's preset.
To remove a specific participant from the session:
-
Check that the local participant has permission to remove participants.
TypeScript const canKickParticipant = meeting.self.permissions.kickParticipant === true;if (!canKickParticipant) {// Disable the control in your UI.} -
Call
kick()on the target participant.If the local participant does not have the required permission,
kick()throws aClientErrorwith code1201.TypeScript try {await participant.kick();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to remove participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds:
- The kicked participant is removed from
meeting.participants.joined. - The participant is removed from other participant maps they were in (for example,
meeting.participants.pinned). - The SDK emits
participantLeftonmeeting.participants.joined.
TypeScript meeting.participants.joined.on("participantLeft", (participant) => {// Remove the participant tile from the UI.});Other participants in the session also observe the participant leaving through
participantLeft. - The kicked participant is removed from
-
On the removed participant's side, the session disconnects and
meeting.selfemitsroomLeftevent with state set tokicked.TypeScript meeting.self.on("roomLeft", ({ state }) => {if (state === "kicked") {// Show a message and navigate the user out of the meeting UI.}});
-
Check that the local participant has permission to remove participants.
TypeScript const canKickParticipant = meeting.self.permissions.kickParticipant === true;if (!canKickParticipant) {// Disable the control in your UI.} -
Call
kick()on the target participant.If the local participant does not have the required permission,
kick()throws aClientErrorwith code1201.TypeScript try {await participant.kick();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to remove participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds:
- The kicked participant is removed from
meeting.participants.joined. - The participant is removed from other participant maps they were in (for example,
meeting.participants.pinned). - The SDK emits
participantLeftonmeeting.participants.joined.
TypeScript meeting.participants.joined.on("participantLeft", (participant) => {// Remove the participant tile from the UI.});Other participants in the session also observe the participant leaving through
participantLeft. - The kicked participant is removed from
-
On the removed participant's side, the session disconnects and
meeting.selfemitsroomLeftevent with state set tokicked.TypeScript meeting.self.on("roomLeft", ({ state }) => {if (state === "kicked") {// Show a message and navigate the user out of the meeting UI.}});
-
Check that the local participant has permission to remove participants.
TypeScript const canKickParticipant = meeting.self.permissions.kickParticipant === true;if (!canKickParticipant) {// Disable the control in your UI.} -
Call
kick()on the target participant.If the local participant does not have the required permission,
kick()throws aClientErrorwith code1201.TypeScript try {await participant.kick();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to remove participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds:
- The kicked participant is removed from
meeting.participants.joined. - The participant is removed from other participant maps they were in (for example,
meeting.participants.pinned). - The SDK emits
participantLeftonmeeting.participants.joined.
TypeScript meeting.participants.joined.on("participantLeft", (participant) => {// Remove the participant tile from the UI.});Other participants in the session also observe the participant leaving through
participantLeft. - The kicked participant is removed from
-
On the removed participant's side, the session disconnects and
meeting.selfemitsroomLeftevent with state set tokicked.TypeScript meeting.self.on("roomLeft", ({ state }) => {if (state === "kicked") {// Show a message and navigate the user out of the meeting UI.}});
- Check that the local participant has permission to remove participants.
val canKickParticipant = meeting.localUser.permissions.host.canKickParticipantif (!canKickParticipant) { // Disable the control in your UI.}- Call
kick()on the target participant. If the local participant does not have the required permission,kick()returns aHostError.
val error = participant.kick()if (error != null) { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, the kicked participant is removed from
meeting.participants.joined.
meeting.addParticipantsEventListener(object : RtkParticipantsEventListener { override fun onParticipantLeave(participant: RtkRemoteParticipant) { // Remove the participant tile from the UI. }})- Check that the local participant has permission to remove participants.
let canKickParticipant = meeting.localUser.permissions.host.canKickParticipantif !canKickParticipant { // Disable the control in your UI.}- Call
kick()on the target participant. If the local participant does not have the required permission,kick()returns aHostError.
if let error = participant.kick() { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, the kicked participant is removed from
meeting.participants.joined.
extension MeetingViewModel: RtkParticipantsEventListener { func onParticipantLeave(participant: RtkRemoteParticipant) { // Remove the participant tile from the UI. }}
// Register the listenermeeting.addParticipantsEventListener(participantsEventListener: self)- Check that the local participant has permission to remove participants.
final canKickParticipant = meeting.localUser.permissions.host.canKickParticipant;if (!canKickParticipant) { // Disable the control in your UI.}- Call
kick()on the target participant.
participant.kick( onResult: (error) { if (error != null) { // Handle error - permission denied or other issue. return; } // Participant removed successfully. },);- Handle the result by listening for updates. After the call succeeds, the kicked participant is removed from
meeting.participants.joined.
class ParticipantsEventsListener extends RtkParticipantsEventListener { @override void onParticipantLeave(RtkRemoteParticipant participant) { // Remove the participant tile from the UI. }}
// Register the listenermeeting.addParticipantsEventListener(ParticipantsEventsListener());- Check that the local participant has permission to remove participants.
const canKickParticipant = meeting.self.permissions.kickParticipant;if (!canKickParticipant) { // Disable the control in your UI.}- Call
kick()on the target participant.
participant .kick() .catch((err) => { // Handle error - permission denied or other issue. console.log(err); });- Handle the result by listening for updates. After the call succeeds, the kicked participant is removed from
meeting.participants.joined.
meeting.participants.joined.on('participantLeft', (participant) => { // Remove the participant tile from the UI.});This removes everyone from the session, including the local participant. This ends the session for everyone.
For a complete end-a-session flow, refer to End a session.
To remove all participants from the session:
-
Check that the local participant has permission to remove participants.
TypeScript const canKickParticipant = meeting.self.permissions.kickParticipant === true;if (!canKickParticipant) {// Disable the control in your UI.} -
Call
kickAll().If the local participant does not have the required permission,
kickAll()throws aClientErrorwith code1201.TypeScript try {await meeting.participants.kickAll();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to remove participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, all participants exit the session. On each client,
meeting.selfemitsroomLeftwith state set toended.TypeScript meeting.self.on("roomLeft", ({ state }) => {if (state === "ended") {// Show a message and navigate the user out of the meeting UI.}});
-
Check that the local participant has permission to remove participants.
TypeScript const canKickParticipant = meeting.self.permissions.kickParticipant === true;if (!canKickParticipant) {// Disable the control in your UI.} -
Call
kickAll().If the local participant does not have the required permission,
kickAll()throws aClientErrorwith code1201.TypeScript try {await meeting.participants.kickAll();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to remove participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, all participants exit the session. On each client,
meeting.selfemitsroomLeftwith state set toended.TypeScript meeting.self.on("roomLeft", ({ state }) => {if (state === "ended") {// Show a message and navigate the user out of the meeting UI.}});
-
Check that the local participant has permission to remove participants.
TypeScript const canKickParticipant = meeting.self.permissions.kickParticipant === true;if (!canKickParticipant) {// Disable the control in your UI.} -
Call
kickAll().If the local participant does not have the required permission,
kickAll()throws aClientErrorwith code1201.TypeScript try {await meeting.participants.kickAll();} catch (err: any) {if (err?.code === 1201) {// The local participant does not have permission to remove participants.return;}throw err;} -
Handle the result by listening for updates.
After the call succeeds, all participants exit the session. On each client,
meeting.selfemitsroomLeftwith state set toended.TypeScript meeting.self.on("roomLeft", ({ state }) => {if (state === "ended") {// Show a message and navigate the user out of the meeting UI.}});
- Check that the local participant has permission to remove participants.
val canKickParticipant = meeting.localUser.permissions.host.canKickParticipantif (!canKickParticipant) { // Disable the control in your UI.}- Call
kickAll()on the participants object. If the local participant does not have the required permission,kickAll()returns aHostError.
val error = meeting.participants.kickAll()if (error != null) { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, all participants exit the session.
meeting.addMeetingRoomEventListener(object : RtkMeetingRoomEventListener { override fun onMeetingEnded() { // Show a message and navigate the user out of the meeting UI. }})- Check that the local participant has permission to remove participants.
let canKickParticipant = meeting.localUser.permissions.host.canKickParticipantif !canKickParticipant { // Disable the control in your UI.}- Call
kickAll()on the participants object. If the local participant does not have the required permission,kickAll()returns aHostError.
if let error = meeting.participants.kickAll() { // Handle error - permission denied.}- Handle the result by listening for updates. After the call succeeds, all participants exit the session.
extension MeetingViewModel: RtkMeetingRoomEventListener { func onMeetingEnded() { // Show a message and navigate the user out of the meeting UI. }}
// Register the listenermeeting.addMeetingRoomEventListener(meetingRoomEventListener: self)- Check that the local participant has permission to remove participants.
final canKickParticipant = meeting.localUser.permissions.host.canKickParticipant;if (!canKickParticipant) { // Disable the control in your UI.}- Call
kickAll()on the participants object.
meeting.participants.kickAll( onResult: (error) { if (error != null) { // Handle error - permission denied or other issue. return; } // All participants removed successfully. },);- Handle the result by listening for updates. After the call succeeds, all participants exit the session.
class MeetingRoomEventsListener extends RtkMeetingRoomEventListener { @override void onMeetingEnded() { // Show a message and navigate the user out of the meeting UI. }}
// Register the listenermeeting.addMeetingRoomEventListener(MeetingRoomEventsListener());- Check that the local participant has permission to remove participants.
const canKickParticipant = meeting.self.permissions.kickParticipant;if (!canKickParticipant) { // Disable the control in your UI.}- Call
kickAll()on the participants object.
meeting.participants .kickAll() .catch((err) => { // Handle error - permission denied or other issue. console.log(err); });- Handle the result by listening for updates. After the call succeeds, all participants exit the session.
meeting.self.on('roomLeft', ({ state }) => { if (state === 'kicked') { // Show a message and navigate the user out of the meeting UI. }});- Review how presets control permissions in Preset.
- Review error handling details in Error Codes.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2026 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-