Display Attendees Count - Android
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
participantsexcept local participant usinggetParticipants()method of the theMeetingclass. With all the participants, we will filter out participants who have joined as aSIGNALLING_ONLYand then display that count.
- Kotlin
- Java
private fun showViewerCount() {
var viewerCount = 1 // start with 1 to count local participant
val participants = meeting!!.participants
for (entry: Map.Entry<String, Participant> in participants.entries) {
val participant = entry.value
if (participant.mode == "SIGNALLING_ONLY") {
viewerCount++
}
}
this.viewerCount!!.text = viewerCount.toString()
}
private void showViewerCount() {
int viewerCount = 1; // start with 1 to count local participant
Map<String, Participant> participants = meeting.getParticipants();
for (Map.Entry<String, Participant> entry : participants.entrySet()) {
Participant participant = entry.getValue();
if (participant.getMode().equals("SIGNALLING_ONLY")) {
viewerCount++;
}
}
this.viewerCount.setText(String.valueOf(viewerCount));
}
API Reference
The API references for all the methods utilized in this guide are provided below.
Got a Question? Ask us on discord

