如何解决WebRTC PeerConnection.getStats错误?

时间:2013-09-09 16:01:01

标签: webrtc opentok tokbox

所以,我们有一个支持WebRTC的应用程序实际上正在建立会话,我们能够连接到它们,人们正在发布流,其他人正在订阅和取消订阅这些流等等。但是我们不断从WebRTC那里得到错误,说'PeerConnection.getStats。已经获得了统计数据!'该错误发生在视频流本身。在黑背景的白色文本,而不是录影。

此外,在控制台日志中,我们收到以下错误:

Uncaught TypeError: Cannot call method 'getStats' of undefined TB.min.js:208
PeerConnection.getStats: Already getting the stats! TB.min.js:54
Subscriber State Change Failed:  'Failed' cannot transition to 'NotSubscribing' TB.min.js:54
Object
 TB.min.js:54
Sending WebSocket message: {"type":1016,"payload":{"streamId":"995827218","fromAddress":"d5e52bf2-03fb-4e3d-885f-297d4d243684","toAddresses":"d5c1a7d8-f70c-44f3-a42c-1c40bab803ca"}} TB.min.js:54
TB.exception :: title: Connection Failed (1013) msg: Subscriber PeerConnection Error: PeerConnection.getStats: Already getting the stats! TB.min.js:54
Subscriber State Change Failed:  'Failed' cannot transition to 'NotSubscribing' TB.min.js:54
Object
 TB.min.js:54
Sending WebSocket message: {"type":1016,"payload":{"streamId":"995827218","fromAddress":"d5e52bf2-03fb-4e3d-885f-297d4d243684","toAddresses":"d5c1a7d8-f70c-44f3-a42c-1c40bab803ca"}} TB.min.js:54
TB.exception :: title: Connection Failed (1013) msg: Subscriber PeerConnection Error: PeerConnection.getStats: Already getting the stats! TB.min.js:54
Subscriber State Change Failed:  'Failed' cannot transition to 'NotSubscribing' TB.min.js:54
Object
 TB.min.js:54
Sending WebSocket message: {"type":1016,"payload":{"streamId":"995827218","fromAddress":"d5e52bf2-03fb-4e3d-885f-297d4d243684","toAddresses":"d5c1a7d8-f70c-44f3-a42c-1c40bab803ca"}} TB.min.js:54
TB.exception :: title: Connection Failed (1013) msg: Subscriber PeerConnection Error: PeerConnection.getStats: Already getting the stats! 

关于可能导致此问题的任何想法?我们如何从轮询统计数据中关闭PeerConnection ?????提前感谢任何建议!

1 个答案:

答案 0 :(得分:1)

我之前没有见过这个,但如果我猜这可能是因为你在订阅之前多次订阅了同一个流。