Skip to main content

Introduction - Room paricipants

The data regarding all meeting participants is stored under meeting.participants. Use the methods and events to consume the participants data.

Room participants object.

  • joined: A list that contains all the participants who have joined the meeting.
  • waitlisted: A list that contains all the participants waiting to join the meeting.
  • active: A list that contains all the participants except the local user who are supposed to be on the screen at the moment
  • pinned: A nullable participant object. If any participant is pinned is that participant else it is null.
  • screenshares: A list that contains all the participants who have shared screen in the meeting.
  • gridInfo: This object has all data related to pages in the room.

Each participant in each of the joined, waitlisted, active and screenshares list is of type DyteMeetingParticipant.

For example, to get all the participants who joined the meeting:

// get all joined participants
let joinedParticipants = meeting.participants.joined;

For example, to get all the active participants in the meeting:

// get all active participants
let joinedParticipants = meeting.participants.active;

Therefore, if you were to make a grid of participants, you'd use the active list, but to display all participants in the meeting you'd use the joined list.

Grid info for the room

Following object can be retrieved from meeting object by using meeting.participants.gridInfo. This object will have necessary information regarding pageCount, next page, previos page, current page, etc.

  let pageCount: Int
let currentPageNumber: Int
let isNextPagePossible: Bool
let isPreviousPagePossible: Bool
let shouldShowPaginator: Bool
let maxVideoCountPerPage: Int

Video update for all participants

Triggered when the user starts / stops the video using enableVideo or disableVideo

extension MeetingViewModel: DyteParticipantEventsListener {
func videoUpdate(videoEnabled: Boolean, participant: DyteMeetingParticipant) {
if (videoEnabled) {
// video is enabled, and other participants in room can see local user
} else {
// video is disabled, and other participants in room can not see local user.
}
}
}

Audio update for all participants

Triggered when the user starts / stops the audio using enableAudio or disableAudio

extension MeetingViewModel: DyteParticipantEventsListener {
func audioUpdate(audioEnabled: Boolean, participant: DyteMeetingParticipant) {
if (audioEnabled) {
// audio is enabled, and other participants in room can hear local user
} else {
// audio is disabled, and other participants in room can not hear local user.
}
}
}

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 control methods

The meeting.participants object has host control methods that allow you to disable the audio and video streams of other users in the meeting (given that the user preset has the right permissions).

// mute all participants
meeting.participants.disableAllAudio()

// mute a single participant
let participantToUpdate = meeting.participants.joined.first
participantToUpdate.disableAudio()

// disable video for all participants
meeting.participants.disableAllVideo()

// disable video for a single participant
let participantToUpdate = meeting.participants.joined.first()
participantToUpdate.disableVideo()

To remove all participants from a meeting, you can call the kickAll() method.

// remove all participants from the meeting
meeting.participants.kickAll()

// remove a single participant
let participantToRemove = meeting.participants.joined.first()
participantToRemove.kick()