onNetworkQuality property

void Function(RtcConnection connection, int remoteUid, QualityType txQuality, QualityType rxQuality)? onNetworkQuality
final

Callback for the last mile uplink and downlink network quality report for each user during the call.

This callback describes the last mile network status of each user during the call. The last mile refers to the network status from the device to the Agora edge server. This callback is triggered every 2 seconds. If there are multiple remote users, it is triggered multiple times every 2 seconds. This callback reports network quality via broadcast packets within the channel. Excessive broadcast packets may cause a broadcast storm. To avoid excessive data transmission due to broadcast storms, this callback supports reporting the network quality of up to 4 remote hosts simultaneously by default. If the user is not sending streams, txQuality is Unknown; if the user is not receiving streams, rxQuality is Unknown.

  • connection Connection information. See RtcConnection.
  • remoteUid User ID. Indicates the network quality report for the user with this ID. If the uid is 0, it reports the local user's network quality.
  • txQuality The user's uplink network quality, calculated based on the sending bitrate, uplink packet loss rate, average round-trip time, and network jitter. This value represents the current uplink network quality and helps determine whether the current video encoding settings are sustainable. For example, if the uplink bitrate is 1000 Kbps, it can support 640 × 480 resolution at 15 fps in a live broadcast scenario, but may struggle to support 1280 × 720 resolution. See QualityType.
  • rxQuality The user's downlink network quality, calculated based on the downlink packet loss rate, average round-trip time, and network jitter. See QualityType.

Implementation

final void Function(RtcConnection connection, int remoteUid,
    QualityType txQuality, QualityType rxQuality)? onNetworkQuality;