Call Statistics
During RTC calls, the underlying RTC library reports detailed call metrics at intervals specified by RCRTCEngineSetup#statsReportInterval
(default: 1 second). This data enables UI prompts and status monitoring.
Register listeners via the setStatsListener
method in RCRTCEngine
.
Detailed Specifications
-
Callback parameters:
onNetworkStats
description:Parameter Type Description stats RCRTCNetworkStats Network status metrics onLocalAudioStats
description:Parameter Type Description stats RCRTCLocalAudioStats Audio transmission metrics onLocalVideoStats
description:Parameter Type Description stats RCRTCLocalVideoStats Video transmission metrics onLocalCustomVideoStats
description:Parameter Type Description tag String Custom video resource TAG stats RCRTCLocalVideoStats Custom video transmission metrics onRemoteAudioStats
description:In live streaming scenarios, hosts can monitor speaking participants' volume levels. In conference mode, all participants receive speaking indicators.
Parameter Type Description roomId String Room ID userId String Remote user ID stats RCRTCRemoteAudioStats Audio reception quality metrics onRemoteVideoStats
description:Parameter Type Description userId String Remote user ID stats RCRTCRemoteVideoStats Video reception quality metrics onLiveMixAudioStats
description:Parameter Type Description stats RCRTCRemoteAudioStats Mixed audio stream reception metrics onLiveMixMemberAudioStats
description:Audience members can monitor hosts' volume levels during live streams.
Parameter Type Description userId String Remote user ID volume int Volume level onLiveMixVideoStats
description:Parameter Type Description stats RCRTCRemoteVideoStats Mixed video stream reception metrics onRemoteCustomVideoStats
description:Parameter Type Description userId String Remote user ID tag String Custom video resource TAG stats RCRTCRemoteVideoStats Custom video reception metrics -
RCRTCNetworkStats
Property Type Description type RCRTCNetworkType Network type (Unknown/WiFi/Cellular) ip String IP address sendBitrate int Upload bitrate (kbps) receiveBitrate int Download bitrate (kbps) rtt int Round-trip delay (ms) -
RCRTCLocalAudioStats
Property Type Description codec RCRTCAudioCodecType Codec type (PCMU/OPUS) bitrate int Bitrate (kbps) volume int Volume level packageLostRate int Packet loss rate (0-100) rtt int Round-trip delay (ms) -
RCRTCLocalVideoStats
Property Type Description tiny bool Stream type (true: thumbnail, false: HD) codec RCRTCVideoCodecType Codec type (H264) bitrate int Bitrate (kbps) fps int Frame rate width int Video width height int Video height packageLostRate int Packet loss rate (0-100) rtt int Round-trip delay (ms) -
RCRTCRemoteAudioStats
Property Type Description codec RCRTCVideoCodecType Codec type (H264) bitrate int Bitrate (kbps) volume int Volume level packageLostRate int Packet loss rate (0-100) rtt int Round-trip delay (ms) -
RCRTCRemoteVideoStats
Property Type Description codec RCRTCVideoCodecType Codec type (H264) bitrate int Bitrate (kbps) fps int Frame rate width int Video width height int Video height packageLostRate int Packet loss rate (0-100) rtt int Round-trip delay (ms)
Sample Code
class StatsListenerImpl implements RCRTCStatsListener {
void onNetworkStats(RCRTCNetworkStats stats) {
// Network status metrics
}
void onLocalAudioStats(RCRTCLocalAudioStats stats) {
// Audio transmission metrics
}
void onLocalVideoStats(RCRTCLocalVideoStats stats) {
// Video transmission metrics
}
void onLocalCustomAudioStats(String tag, RCRTCLocalAudioStats stats) {
// Currently unused
}
void onLocalCustomVideoStats(String tag, RCRTCLocalVideoStats stats) {
// Custom video transmission metrics
}
void onRemoteAudioStats(String userId, RCRTCRemoteAudioStats stats) {
// Audio reception metrics
}
void onRemoteVideoStats(String userId, RCRTCRemoteVideoStats stats) {
// Video reception metrics
}
void onLiveMixAudioStats(RCRTCRemoteAudioStats stats) {
// Mixed audio stream metrics
}
void onLiveMixVideoStats(RCRTCRemoteVideoStats stats) {
// Mixed video stream metrics
}
void onRemoteCustomAudioStats(String userId, String tag, RCRTCRemoteAudioStats stats) {
// Currently unused
}
void onRemoteCustomVideoStats(String userId, String tag, RCRTCRemoteVideoStats stats) {
// Custom video reception metrics
}
}
/// Register stats listener
engine.setStatsListener(StatsListenerImpl());
/// Remove stats listener
engine.setStatsListener(null);