onEnterRoom property

(void Function(int result)?) onEnterRoom
final

Whether Room Entry is Successful

After calling the enterRoom() API in TRTCCloud to enter a room, you will receive the onEnterRoom(result) callback from TRTCCloudDelegate.

  • If room entry succeeded, result will be a positive number (result > 0), indicating the time in milliseconds (ms) the room entry takes.
  • If room entry failed, result will be a negative number (result < 0), indicating the error code for the failure.

For more information on the error codes for room entry failure, see Error Codes.

  • Parameters:
    • result(int):
      • If result is greater than 0, it indicates the time (in ms) the room entry takes; if result is less than 0, it represents the error code for room entry.

Note

  1. In TRTC versions below 6.6, the onEnterRoom(result) callback is returned only if room entry succeeds, and the onError() callback is returned if room entry fails.
  2. In TRTC 6.6 and above, the onEnterRoom(result) callback is returned regardless of whether room entry succeeds or fails, and the onError() callback is also returned if room entry fails.

Implementation

final void Function(int result)? onEnterRoom;