setClientRole method
Sets the role of a user (ChannelProfile.LiveBroadcasting only).
This method sets the role of a user, such as a host or an audience (default), before joining a channel.
This method can be used to switch the user role after a user joins a channel. In the ChannelProfile.LiveBroadcasting profile, when a user switches user roles after joining a channel, a successful setClientRole
method call triggers the following callbacks:
- The local client: RtcEngineEventHandler.clientRoleChanged.
- The remote client: RtcEngineEventHandler.userJoined or RtcEngineEventHandler.userOffline (UserOfflineReason.BecomeAudience).
Parameter role
Sets the role of a user. See ClientRole.
Implementation
@override
Future<void> setClientRole(ClientRole role) {
return _invokeMethod(
'setClientRole', {'role': ClientRoleConverter(role).value()});
}