Skip to main content
Version: 4.x.x

Mute All Participants - iOS

If you are the host or moderator of a video conference, you may want to mute all the participants at once. This can be useful in various scenarios, such as when you want to deliver a presentation or when there is background noise that is causing distractions.

  • To achieve this, you have to iterate over the list of participants from the Room class and call disableMic method from Participant class.
  • room.participants holds the remote participants. disableMic() is async throws, so call it with try await inside a Task. Catch the error for each participant, so that one failure does not stop the rest.
extension RoomViewController {
//Button when tapped will turn off mic of all participants
@IBAction func muteAllButtonTapped(_ sender: Any) {
guard let participants = room?.participants.values else { return }
Task {
for participant in participants {
do {
try await participant.disableMic()
} catch {
print("Could not mute \(participant.displayName): \(error)")
}
}
}
}
}
note

The participant who mutes other participants needs 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


Was this helpful?

Not helpfulHelpful