setClientRole method

Future<void> setClientRole(
  1. ClientRole role, [
  2. ClientRoleOptions? options
])

Sets the user role and level in an interactive live streaming channel. In the interactive live streaming profile, the SDK sets the user role as audience by default. You can call this method to set the user role as host. You can call this method either before or after joining a channel. If you call this method to switch the user role after joining a channel, the SDK automatically does the following: Calls muteLocalAudioStream and muteLocalVideoStream to change the publishing state. Triggers clientRoleChanged on the local client. Triggers userJoined or userOffline on the remote client. This method applies to the interactive live streaming profile (the profile parameter of setChannelProfile is LiveBroadcasting) only.

Param role The user role in the interactive live streaming. See ClientRole .

Param options The detailed options of a user, including the user level. See ClientRoleOptions for details.

Implementation

Future<void> setClientRole(ClientRole role, [ClientRoleOptions? options]) async {
  await _engine!.setClientRole(role, options);
}