localStream.getStats回调不执行

localStream.getStats((stats) => {
console.log(Local Stream accessDelay: ${stats.accessDelay});
console.log(Local Stream audioSendBytes: ${stats.audioSendBytes});
console.log(Local Stream audioSendPackets: ${stats.audioSendPackets});
console.log(Local Stream audioSendPacketsLost: ${stats.audioSendPacketsLost});
console.log(Local Stream videoSendBytes: ${stats.videoSendBytes});
console.log(Local Stream videoSendFrameRate: ${stats.videoSendFrameRate});
console.log(Local Stream videoSendPackets: ${stats.videoSendPackets});
console.log(Local Stream videoSendPacketsLost: ${stats.videoSendPacketsLost});
console.log(Local Stream videoSendResolutionHeight: ${stats.videoSendResolutionHeight});
console.log(Local Stream videoSendResolutionWidth: ${stats.videoSendResolutionWidth});
});

数据可能需要耗费 0-3 秒时间返回。请尝试循环调用:

setInterval(() => {
    ...
}, 1000)

setInterval(() => {
localStream.getStats((stats) => {
console.log(stats);
});
}, 1000)

远端的可以 但是本地的不执行