onClientRoleChanged property

void Function(RtcConnection connection, ClientRoleType oldRole, ClientRoleType newRole, ClientRoleOptions newRoleOptions)? onClientRoleChanged
final

Occurs when the user role switches in the interactive live streaming. The SDK triggers this callback when the local user switches the user role by calling setClientRole after joining the channel.

  • connection The connection information. See RtcConnection .
  • oldRole Role that the user switches from: ClientRoleType .
  • newRole Role that the user switches to: ClientRoleType .

Implementation

final void Function(
    RtcConnection connection,
    ClientRoleType oldRole,
    ClientRoleType newRole,
    ClientRoleOptions newRoleOptions)? onClientRoleChanged;