Quality | 名称 | 说明 |
0 | Unknown | 未感知到 |
1 | Excellent | 当前网络非常好 |
2 | Good | 当前网络比较好 |
3 | Poor | 当前网络一般 |
4 | Bad | 当前网络较差,可能会出现明显的卡顿和通话延迟 |
5 | VeryBad | 当前网络很差,TRTC 只能勉强保持连接,但无法保证通讯质量 |
6 | Down | 当前网络不满足 TRTC 的最低要求,无法进行正常的音视频通话 |
import TRTCCloud, { TRTCQuality } from 'trtc-electron-sdk';const rtcCloud = new TRTCCloud();function onNetworkQuality(localQuality, remoteQuality) {switch(localQuality.quality) {case TRTCQuality.TRTCQuality_Unknown:console.log('SDK has not yet sensed the current network quality.');break;case TRTCQuality.TRTCQuality_Excellent:console.log('The current network is very good.');break;case TRTCQuality.TRTCQuality_Good:console.log('The current network is good.');break;case TRTCQuality.TRTCQuality_Poor:console.log('The current network quality barely meets the demand.');break;case TRTCQuality.TRTCQuality_Bad:console.log('The current network is poor, and there may be significant freezes and call delays.');break;case TRTCQuality.TRTCQuality_Vbad:console.log('The current network is very poor, the communication quality cannot be guaranteed.');break;case TRTCQuality.TRTCQuality_Down:console.log('The current network does not meet the minimum requirements.');break;default:break;}for (let i = 0; i < remoteQuality.length; i++) {console.log(`remote user: ${remoteQuality[i].userId}, quality: ${remoteQuality[i].quality}`);}}rtcCloud.on('onNetworkQuality', onNetworkQuality);
本页内容是否解决了您的问题?