Skip to main content
Version: 2.0.x

Display Attendees Count - iOS

In this guide, we will see how you can display the number of attendees in realtime.

note

Before going forward in this guide, do make sure all the attendees join the meeting with mode as SIGNALLING_ONLY

  • We will get the all the participants except local participant using participants property of the the Meeting class. With all the participants, we will filter out participants who have joined as a SIGNALLING_ONLY and then display that count.
class LiveStreamViewController: ObservableObject {
@Published var viewerParticipantCount: Int = 0

//...
}

extension LiveStreamViewController: MeetingEventListener {
func onMeetingJoined() {
//...
viewerParticipantCount = 1
}

func onParticipantJoined(_ participant: Participant) {
//...
viewerParticipantCount +=
meeting?.participants.values.count { $0.mode == .SIGNALLING_ONLY } ?? 0
}
}

API Reference

The API references for all the methods utilized in this guide are provided below.

Got a Question? Ask us on discord


Was this helpful?