onClientRoleChanged property

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

Callback when the user role or audience latency level is switched.

This callback is not triggered if you call setClientRole before joining a channel and set the role to BROADCASTER.

  • connection Connection information. See RtcConnection.
  • oldRole Role before switching: ClientRoleType.
  • newRole Role after switching: ClientRoleType.
  • newRoleOptions Properties of the new role. See ClientRoleOptions.

Implementation

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