setUserVisibility abstract method
Sets user visibility. The local user is visible to others by default before calling this API.
Set user visibility and user behavior in the room through enable
:
- true: The user can publish media streams. The other users in the room can get informed of the behaviors of this user, such as joining room, starting video capture, and leaving room.
- false: The user cannot publish media streams. The other users in the room can not get informed of the behaviors of this user, such as joining room, starting video capture, or leaving room.
Return value:
0
: Success.<0
: Failure. See ReturnStatus for the reason.
Notes:
- You can call this API whether the user is in a room or not.
- When you call this API, the other users in the room will be notified with the related callback:
- Switch from
false
totrue
: RTCRoomEventHandler.onUserJoined. - Switch from
true
tofalse
: RTCRoomEventHandler.onUserLeave.
- Switch from
- The invisible user will receive RTCVideoEventHandler.onWarning when trying to publish media streams.
Implementation
Future<int?> setUserVisibility(bool enable);