Skip to main content
Version: 1.2.x

Mute All Participants - Flutter

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 object and call muteMic method on each Participant object.
import 'package:flutter/material.dart';
import 'package:videosdk/videosdk.dart';

class MeetingScreen extends StatefulWidget {
...
}

class _MeetingScreenState extends State<MeetingScreen> {
late Room _room;

@override
void initState() {
...
}

@override
Widget build(BuildContext context) {
return Column(
children:[
ElevatedButton(
child: Text("Mute all participants"),
onPressed: () => {
_room.participants.values.forEach((participant) {
participant.muteMic();
});
}),
]
);
}
}
note

Participant who will be muting other participants should have permission allow_mod passed in the 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?