muteLocalVideoStream method Null safety

Future<void> muteLocalVideoStream(
  1. bool muted

Stops or resumes publishing the local video stream.

Parameter muted Sets whether to stop publishing the local video stream.

  • true: Stop publishing the local video stream.
  • false: Resume publishing the local video stream.

This method only sets the publishing state of the video stream in the channel of RtcChannel.

A successful method call triggers the remoteVideoStateChanged callback on the remote client.

You can only publish the local stream in one channel at a time. If you create multiple channels, ensure that you only call muteLocalVideoStream(false) in one channel; otherwise, the method call fails, and the SDK returns -5 (Refused).


  • This method does not change the usage state of the video-capturing device.
  • Whether this method call takes effect is affected by the joinChannel and setClientRole methods. For details, see Set the Publishing State.


Future<void> muteLocalVideoStream(bool muted) {
  return _invokeMethod('muteLocalVideoStream', {
    'muted': muted,