onLeaveRoom method
@detail callback
@region Multiple rooms
@author shenpengliang
@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 #RTCRoom#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! IRTCRoomEventHandler) {
return;
}
return ($instance as IRTCRoomEventHandler).onLeaveRoom?.call(packObject(
stats,
() => RTCRoomStats.fromMap(RTCRoomStats.deepPackedMapValues(
RTCRoomStats.mapMemberToConstructorParams(stats)))));
}