Mute All Participants - Android
A host or moderator can mute every participant at once, for example before a presentation or when background noise distracts the room.
- Loop over
room.participantsand calldisableMic()on eachParticipant. disableMic()is asuspendfunction, so call it from a coroutine. It throws aVideoSDKExceptionif the server refuses the request.room.participantschanges as people join and leave, so iterate over a copy of it.- Skip AI agents: on an agent,
disableMic()always throwsUnsupportedOperationException.
btnMuteAllParticipant!!.setOnClickListener { _: View? ->
lifecycleScope.launch {
for (participant in room.participants.values.toList()) {
if (participant.isAgent()) continue
try {
participant.disableMic()
} catch (e: VideoSDKException) {
Log.d("VideoSDK", "Could not mute ${participant.displayName}: ${e.code} ${e.message}")
}
}
}
}
note
The participant who mutes other participants must have the allow_mod permission in their token. To know more about permissions visit here.
API Reference
The API references for all the methods and events utilised in this guide are provided below.
Got a Question? Ask us on discord

