Mic Controls - Flutter
Whenever any participant wants to start / stop broadcasting their audio to other participant in room, they can simply do it with VideoSDK room.
This guide will provide an overview of how to use enable and disable Mic in a room.
- Enable Mic - By using
unmuteMic()
function, a participant can publish audio to other participants. - Disable Mic - By using
muteMic()
function, a participant can stop publishing audio to other participants. - Change Mic - By using
changeMic()
function, a participant can change mic.
Enable, Disable, Change Mic​
ElevatedButton(
onPressed: room.unmuteMic,
child: Text("unmuteMic"),
),
ElevatedButton(
onPressed: room.muteMic,
child: Text("muteMic"),
),
// changeMic() method is coming soon in flutter.
Events​
Events associated with unmuteMic()
:
streamEnabled
event will be emitted withstream
object from the event callback, inside that participant object.
Events associated with muteMic()
:
streamDisabled
event will be emitted withstream
object from the event callback, inside that participant object.
participant.on(Events.streamEnabled, (Stream stream){
if (stream.kind === "audio") {
//particiapnt turned on audio
}
});
participant.on(Events.streamDisabled, (Stream stream){
if (stream.kind === "audio") {
//particiapnt turned off audio
}
});
Got a Question? Ask us on discord