The participant object
The data regarding all meeting participants is stored under meeting.participants
. Use the methods and events to consume the participants data.
The participant
object consists of all the information related to a particular participant. For instance, it contains a participants video/audio/screenshare stream, and the participant's name. It also contains state variables that indicate whether a participant's camera is on or off, and whether they are muted or unmuted.
The participant object has the following properties.
id
: TheparticipantId
of the participant (akapeerId
).userId
: TheuserId
of the participant.name
: The participant's name.picture
: The participant's picture (if any).customParticipantId
: A customizable ID that can be set to identify the participant.videoEnabled
: Set to true if the participant's camera is on.audioEnabled
: Set to true if the participant is unmuted.isPinned
: True if current user is pinned in the meeting room.presetName
: Name of the preset associated with the participant.stageStatus
: Status of stage for the participant
To get video view of a given participant
You can call participant.getVideoView()
which will return a View
that renders
the participant's video stream.
Similarly one can use participant.getScreenShareVideoView()
which will return a
View
that renders the participant's screenshare stream.
Similarly, you can also access pagination related information:
val maxNumberOnScreen = meeting.participants.maxNumberOnScreen
val currentPageNumber = meeting.participants.currentPageNumber
val pageCount = meeting.participants.pageCount
val canGoNextPage = meeting.participants.canGoNextPage
val canGoPreviousPage = meeting.participants.canGoPreviousPage
Move between pages in paginated mode
The setPage
method allows you to switch between pages of participants present in the meeting.
// switch to 1st page
meeting.participants.setPage(1)
Host Controls
If you (the local user) have the relevant permissions, you can disable a participant's video or audio, or kick them from the meeting.
All methods return an optional HostError
which is non-null if the operation fails.
val participant = meeting.participants.joined.firstOrNull { it.id == participantId }
participant?.let { pcpt ->
// To disable a participant's video stream
val videoError = pcpt.disableVideo()
// To disable a participant's audio stream
val audioError = pcpt.disableAudio()
// To kick a participant from the meeting
val kickError = pcpt.kick()
}
You can also pin
or unpin
a participant in the meeting. All "pinned" participants are added to the meeting.participants.pinned
list.
The methods return an optional HostError
which is non-null if the operation fails.
val participant = meeting.participants.joined.firstOrNull { it.id == participantId }
participant?.let { pcpt ->
// To pin a participant
val pinError = pcpt.pin()
// To unpin a participant
val unpinError = pcpt.unpin()
}
Broadcast message to all participants
Send a message to all joined
participants.
Parameters
type
: A client-specific type to differentiate between custom messages like "emoji" or "greetings"
payload
: A map of type Map<String, Any>
containing the message payload.
// broadcast message
meeting.participants.broadcastMessage(type, payload)