onLeaveRoom method

FutureOr<void> onLeaveRoom(
  1. dynamic stats
)
override

@detail callback @brief Leave the room successfully callback.
After the user calls the leaveRoom{@link #RTSRoom#leaveRoom} method, the SDK will stop all publishing subscription streams, and after releasing all call-related audio & video resources, this callback will notify the user to leave the room successfully. @param stats Reserved parameter. @note - After the user calls the leaveRoom{@link #RTSRoom#leaveRoom} method to leave the room, if destroy{@link #RTSRoom#destroy} is called to destroy the room instance or destroyRTCEngine{@link #RTCEngine#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> onLeaveRoom(dynamic stats) async {
  if ($instance == null || $instance is! IRTSRoomEventHandler) {
    return;
  }
  return ($instance as IRTSRoomEventHandler).onLeaveRoom?.call(packObject(
      stats,
      () => RTCRoomStats.fromMap(RTCRoomStats.deepPackedMapValues(
          RTCRoomStats.mapMemberToConstructorParams(stats)))));
}