rtcRoom$onLeaveRoom method

FutureOr<void> rtcRoom$onLeaveRoom(
  1. dynamic rtcRoom,
  2. dynamic stats
)
override

@detail callback @region Multiple rooms @author shenpengliang @brief Leave the room successfully callback.
When the user calls the leaveRoom{@link #ByteRTCRoom#leaveRoom} method, the SDK stops all publish subscription streams and releases all call-related audio & video resources. This callback notifies the user when the SDK completes all resource releases. @param rtcRoom ByteRTCRoom object. @param stats Reserved parameter. @note - After the user calls the leaveRoom{@link #ByteRTCRoom#leaveRoom} method to leave the room, if destroy{@link #ByteRTCRoom#destroy} is called to destroy the room instance or destroyRTCEngine{@link #ByteRTCEngine#destroyRTCEngine} method is called to destroy the RTC engine immediately, this callback event will not be received. - If the app needs to use the system audio & video device after leaving the room, it is recommended to initialize the audio & video device after receiving this callback, otherwise the initialization may fail due to the SDK occupying the audio & video device.

Implementation

FutureOr<void> rtcRoom$onLeaveRoom(dynamic rtcRoom, dynamic stats) async {
  if ($instance == null || $instance is! IRTCRoomEventHandler) {
    return;
  }
  return ($instance as IRTCRoomEventHandler).onLeaveRoom?.call(packObject(
      stats,
      () => RTCRoomStats.fromMap(RTCRoomStats.deepPackedMapValues(
          RTCRoomStats.mapMemberToConstructorParams(stats)))));
}