onRemoteStreamStats method

FutureOr<void> onRemoteStreamStats(
  1. dynamic streamId,
  2. dynamic streamInfo,
  3. dynamic stats
)
override

@detail callback @author yejing @brief Remote audio/video stream statistics and network quality callbacks for local subscriptions.
After the local user subscribes to the stream successfully, the SDK will periodically (2s) notify the user through this callback event of the quality statistics of the subscribed stream during this reference period, including: sending audio & video bit rate, sending frame rate, encoded frame rate, network quality, etc. @param streamId The ID of the stream, used to identify a specific remote stream. @param streamInfo The stream information structure, containing detailed information such as room ID and user ID. See StreamInfo{@link #StreamInfo}. @param stats Audio & video stream and network status statistics. See RemoteStreamStats{@link #RemoteStreamStats}.

Implementation

FutureOr<void> onRemoteStreamStats(
    dynamic streamId, dynamic streamInfo, dynamic stats) async {
  if ($instance == null || $instance is! IRTCRoomEventHandler) {
    return;
  }
  return ($instance as IRTCRoomEventHandler).onRemoteStreamStats?.call(
      streamId.toString(),
      packObject(
          streamInfo,
          () => StreamInfo.fromMap(StreamInfo.deepPackedMapValues(
              StreamInfo.mapMemberToConstructorParams(streamInfo)))),
      packObject(
          stats,
          () => RemoteStreamStats.fromMap(
              RemoteStreamStats.deepPackedMapValues(
                  RemoteStreamStats.mapMemberToConstructorParams(stats)))));
}