setUserVisibility method Null safety

Future<void> setUserVisibility(
  1. bool enable
)

设置用户可见性,默认为可见

通过 enable 设置用户可见性和用户在房间内的行为:

  • true: 可以被房间中的其他用户感知,且可以在房间内发布和订阅音视频流;
  • false: 无法被房间中的其他用户感知,且只能在房间内订阅音视频流。

注意:

  • 该方法在加入房间前后均可调用。
  • 在房间内调用此方法,房间内其他用户会收到相应的回调通知:
  • 若调用该方法将可见性设为 false,此时尝试发布流会收到 RTCEngineEventHandler.onWarning

Implementation

Future<void> setUserVisibility(bool enable);