Skip to main content

Participant Management

Learn how to access participants in a VideoSDK room, manage participant modes, control remote participants, and perform participant operations from your server.

Each participant has a unique participantId along with information such as their display name, mode, and published media streams.

Access local and remote participants

When your client joins a room, VideoSDK creates a local participant representing the current user.

Everyone else connected to the room is represented as a remote participant. As remote participants publish audio, video, or screen-share streams, those streams become available through their participant objects.

const { localParticipant, participants } = useMeeting();

// participants is a Map<participantId, Participant>
[...participants.keys()].map((participantId) => (
<ParticipantView key={participantId} participantId={participantId} />
));

Use useParticipant(participantId) to access the properties, streams, and controls for a specific participant, including the local participant.

Manage participant modes

A participant's mode determines whether they can publish or receive realtime media.

The three participant modes are described in Rooms, Sessions, Participants, and Streams.

You can change the local participant's mode after they join the room. When the mode changes, connected clients receive an onParticipantModeChanged event.

For example, promoting a viewer to the stage in an interactive live stream typically changes their mode from RECV_ONLY or SIGNALLING_ONLY to SEND_AND_RECV.

const { changeMode } = useMeeting();

await changeMode(Constants.modes.SEND_AND_RECV);

For an interactive live streaming example, see Manage roles.

Participant properties

Participant objects expose information about the user and the media they are publishing.

For example, React's useParticipant(participantId) hook provides the following commonly used properties:

PropertyTypeDescription
displayNamestringDisplay name provided when the participant joined.
participantParticipantUnderlying participant object containing properties such as id, displayName, local, and the participant's streams map.
isLocalbooleantrue when the participant represents the current client.
modestringCurrent participant mode: SEND_AND_RECV, RECV_ONLY, or SIGNALLING_ONLY.
metaDataobjectCustom metadata passed when the participant joined, such as a profile image URL or application-specific role.
webcamOn / micOn / screenShareOnbooleanIndicates whether the corresponding media stream is currently being published.
webcamStream / micStream / screenShareStreamStreamProvides access to the participant's camera, microphone, and screen-share streams. See Stream management.
isActiveSpeakerbooleantrue while the participant is detected as the active speaker.

Equivalent participant information is available across the client SDKs using platform-specific naming and APIs.

See the useParticipant reference for the complete React API.

Moderate remote participants

Participants with moderation permissions can control certain actions for other participants in the room.

Moderation requires the allow_mod grant in the moderator's token. See How a client connects for more information about token permissions.

MethodWhat it doesEvent behavior
enableMic() / enableWebcam()Requests that the participant enable their microphone or camera.The target receives onMicRequested or onWebcamRequested and can call accept() or reject().
disableMic() / disableWebcam()Disables the participant's microphone or camera immediately.Connected participants receive onStreamDisabled.
remove()Disconnects the participant from the room.The removed participant receives onMeetingLeft with reason REMOVE_PEER; other participants receive onParticipantLeft.
pin() / unpin()Pins or unpins the participant's camera, screen share, or both using CAM, SHARE, or SHARE_AND_CAM.Connected participants receive onPinStateChanged.
const {
enableMic,
disableWebcam,
remove,
pin,
} = useParticipant(participantId);

await enableMic(); // asks the participant to unmute
await disableWebcam(); // turns their camera off now
await pin("CAM"); // pin their camera tile
await remove(); // remove them from the room

For complete moderation flows, see Toggle remote participant media and Remove participant.

Manage participants from your server

You can also retrieve and remove participants from your backend using the VideoSDK Server SDK or REST API.

The Server SDK participants resource operates on the currently active session for a room. When using the Server SDK, you provide the roomId, and the SDK resolves the active session.

For REST API requests, participant endpoints operate on a sessionId. You can retrieve the current session for a room first with:

GET /v2/sessions?roomId=ROOM_ID

For Server SDK initialization, see Room management.

List active participants

List the participants currently connected to a room.

If the room does not have an active session, the request returns an empty page.

curl "https://api.videosdk.live/v2/sessions/$SESSION_ID/participants/active?page=1&perPage=20" \
-H "Authorization: $VIDEOSDK_TOKEN"

# { "pageInfo": { ... }, "data": [ { "participantId": "...", "name": "..." } ] }

Get a participant

Retrieve a specific active participant by their participantId.

When using the Server SDK, the room must have an active session.

curl "https://api.videosdk.live/v2/sessions/$SESSION_ID/participants/active" \
-H "Authorization: $VIDEOSDK_TOKEN"

# Filter `data[]` by participantId.
# There is no single-participant REST endpoint.

Remove a participant

Remove an active participant from a room.

The participant is disconnected from the current session and receives onMeetingLeft with the reason REMOVE_PEER, matching the behavior of the client-side remove() moderation method.

curl -X POST https://api.videosdk.live/v2/sessions/participants/remove \
-H "Authorization: $VIDEOSDK_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "roomId": "'"$ROOM_ID"'", "participantId": "participant-alice" }'

# Add "sessionId" to the body to target a specific session.

Server-side Participant object

The Server SDK returns a Participant object when you retrieve a participant or iterate through a participant list.

FieldTypeDescription
participantIdstringUnique identifier for the participant.
namestringParticipant's display name, when available.
timelogobject[]Join and leave intervals for the participant. Each entry contains start and end; end remains null while the participant is connected.

For participants from previous sessions and participant-level quality statistics, see the Sessions reference.

Next steps