BRTC 提供两套关于通话质量反馈的回调:
#pragma mark - >>>>>>>>>>>>>>>>>>>BRTC 回调<<<<<<<<<<<<<<<<<<<<<< - (void)onStatistics:(BRTCStatistics *)statistics { NSMutableString *text = [NSMutableString string]; [text appendFormat:@"RTT: %d ms \n", statistics.rtt]; [text appendFormat:@"up Packet Loss: %u\n",statistics.upLoss]; [text appendFormat:@"down Packet Loss: %u\n",statistics.downLoss]; [text appendFormat:@"cpu usage: %u\n",statistics.cpu]; for (BRTCLocalStatistics *local in statistics) { [text appendFormat:@"Resolution: %d X %d\n",local.width, local.height]; [text appendFormat:@"Video Send Bitrate: %.2u kps \n", local.videoBitrate]; [text appendFormat:@"Audio Send Bitrate: %.2u kps \n", local.audioBitrate]; [text appendFormat:@"Video Send FPS: %.1u fps \n", local.frameRate]; [text appendFormat:@"local streamType: %d \n", local.streamType]; } for (remoteStatistics *remote in statistics) { [text appendFormat:@"Resolution: %d X %d\n", remote.width,remote.height]; [text appendFormat:@"Audio Recv Bitrate: %.2u kps \n", remote.audioBitrate]; [text appendFormat:@"Video Recv Bitrate: %.2u kps \n", remote.videoBitrate]; [text appendFormat:@"Video Recv FPS: %.1u fps \n", remote.frameRate]; [text appendFormat:@"Delay: %d ms \n", remote.jitterBufferDelay]; [text appendFormat:@"remote stream type: %d \n", remote.streamType]; } [self appendLog:[NSString stringWithFormat:@"quality: %@", text]]; } - (void)onNetworkQuality:(NSArray<BRTCCollectionQuality *> *)qualityArray { for (BRTCCollectionQuality *quality in qualityArray) { NSLog(@"onNetworkQuality, %@, %ld", quality.userId, quality.qualityLevel); } }
通话质量检测
BRTC 提供两套关于通话质量反馈的回调:
示例代码