rtcRoom$onRoomStats method

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

@detail callback @author yejing @brief In-room call statistics callback.
After the user enters the room and starts the call, he receives this callback every 2s. @param rtcRoom ByteRTCRoom object. @param stats Current ByteRTCRoom statistics, see: ByteRTCRoomStats{@link #ByteRTCRoomStats}

Implementation

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