onSwitchRole property

(void Function(int errCode, String errMsg)?) onSwitchRole
final

Role Switching

You can call the switchRole() API in TRTCCloud to switch between the anchor and audience roles. This is accompanied by a line switching process.

After the switching, the SDK will return the onSwitchRole() event callback.

  • Parameters:
    • errCode(int):
      • Error code. ERR_NULL indicates a successful switch. For more information, please see Error Codes.
    • errMsg(String):
      • Error message.

Implementation

final void Function(int errCode, String errMsg)? onSwitchRole;