Skip to main content
Version: 1.x.x

Remove Participant - React

Remove participant allows removing participant while session is on-going. This can be helpful when moderation in particular meeting is required.

import { useParticipant } from "@videosdk.live/react-sdk";

const ParticipantView = () => {
// Get specific participant instance
const { remove } = useParticipant("<participant-id>");

const onPress = async () => {
// Remove participant from active session
// This will emit an event called "onParticipantLeft" to that particular participant
try {
await remove();
} catch (err) {
console.error("remove failed:", err);
}
};
return <>...</>;
};
note

This page uses the following asynchronous methods. Refer to their API reference for the errors each Promise may reject with, and handle these rejections appropriately based on your use case.

Events

onParticipantLeft - Removing participant will trigger onParticipantLeft event.

import { useMeeting, useParticipant } from "@videosdk.live/react-native-sdk";

/** useMeeting hooks events */
const {
/** Methods */
} = useMeeting({
onParticipantLeft: (participant) => {
// Triggers when a participant is removed or leaves the meeting.
},
});

Got a Question? Ask us on discord


Was this helpful?