Participant controls

We provide methods and properties to help you control participant actions and certain UI elements. This could include actions that affect the participant themselves as well as other participants (like a host with privileged permissions may want to control the video of other participants). This section defines all the available properties and methods for the participants.

πŸ“˜

Permission based controls

Remember that despite the functions being available to every participant via the client SDK, they will not take affect until coupled with the right permissions for the participant who intends to use these.

To get a list of all participants, use meeting.participants: it returns Array[DyteParticipant|DyteSelfParticipant] where all meeting participants are DyteParticipant and the current participant is DyteSelfParticipant.

DyteParticipant

Property / Method name

Data type

Use

id

string

Peer ID of the participant

clientSpecificId

any

Client specific ID for this participant that was passed to the add participant API

name

string

Name set by the participant or as sent in the add participant API

picture

string

URL of the participant picture, as sent in the add participant API

audioEnabled

boolean

Checks if the participant is producing audio

videoEnabled

boolean

Checks if the participant is producing video

audioTrack

MediaStreamTrack

Audio stream from the participant

videoTrack

MediaStreamTrack

Video stream from the participant

isMe

boolean

Checks if the participant is the current participant, in which case it can be treated as DyteSelfParticipant

isPinned

boolean

Checks if the participant video is pinned (by the host, by the user, or by the preset)

pin()

void

Pin the participant video to the grid for everyone in the meeting

unpin()

void

Unpin the participant video from the grid for everyone in the meeting

disableAudio()

void

Disable audio stream from another participant, effectively muting them for everyone in the meeting

disableVideo()

void

Disable video stream from another participant, effectively blanking them out for everyone in the meeting

zoom({ scale: number, x: number, y: number})

void

Zoom on to a participant's video for everyone in the meeting. Scale represents the scale of zoom, whereas x and y represent the offset from center to reposition the video inside the container.

setOverlay(overlay: ReactNode)

void

Set an overlay on the participant video (see Video overlays for more details)

sendMessage(message: any)

void

Send custom event to the participant

DyteSelfParticipant

Other than the properties and methods of DyteParticipant, the DyteSelfParticipant allows access to following:

Property / Method name

Data type

Name

isScreensharing

boolean

Checks if the current participant is sharing the screen

enableAudio()

void

Enable audio stream sharing from the participant to the meeting

enableVideo()

void

Enable video stream sharing from the participant to the meeting

enableScreenshare()

void

Enable screen sharing from the participant to the meeting

disableScreenshare()

void

Disable screen sharing from the participant to the meeting


What’s Next