Skip to main content

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: The participantId of the participant (aka peerId).
  • userId: The userId of the participant.
  • name: The participant's name.
  • picture: The participant's picture (if any).
  • clientSpecificId: An arbitrary ID that can be set to identify the participant.
  • videoTrack: The video track of the participant.
  • screenShareTrack: The video and audio (if any) track of the participant's screen share stream.
  • 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
  • maxNumberOnScreen: A int showing the maximum number of people set for this meeting.
  • currentPageNumber: A int showing the current page in this meeting. Participants from this page are filled in the active list.
  • pageCount: A int showing total number of pages available in the meeting.
  • canGoNextPage: A boolean indicating if next page of joined participants is available to show.
  • canGoPreviousPage: A boolean indicating if previous page of joined participants is available to show.

To get video view of a given participant

You can call participant.getVideoView() which will return a View which further can used to add in any ViewGroup in android.

Similarly one can use participant.getScreenShareView() which will return a View which further can used to add in any ViewGroup in android.

Similarly, you can also access the pagination related information like follows:

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(pageNumber: Int) 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.

val participant = meeting.participants.joined.firstOrNull { it.id == participantId }

participant?.let { pcpt ->
// To disable a participant's video stream
pcpt.disableVideo();

// To disable a participant's audio stream
pcpt.disableAudio();

// To kick a participant from the meeting
pcpt.kick();
}

You can also pin or unpin a participant in the meeting. All "pinned" participants are added to the meeting.participants.pinned list.

val participant = meeting.participants.joined.firstOrNull { it.id == participantId }

participant?.let { pcpt ->
// To pin a participant
pcpt.pin();

// To unpin a participant
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 containing the message payload, where keys are strings and values are of Any type.

// broadcast message
meeting.participants.broadcastMessage(type, payload)