setMicrophoneMuted method
Mutes/unmutes mic at the ADM level (iOS/macOS only), allowing detection of "speaking while muted."
No Android support: mute the local audio track there instead. Throws UnsupportedError elsewhere; guard with isAdmMicrophoneMuteSupported.
Implementation
Future<void> setMicrophoneMuted(bool muted) async {
_checkAdmMuteSupported('setMicrophoneMuted');
_checkDisposed('setMicrophoneMuted');
try {
await WebRTC.invokeMethod(
'appleAdmSetMicrophoneMuted',
<String, dynamic>{
'factoryId': factoryId,
'muted': muted,
},
);
} on PlatformException catch (e) {
throw 'Unable to set microphone muted: ${e.message}';
}
}