How do I resolve a WebRTC PeerConnection.getStats error?

最后都变了- 提交于 2019-12-08 08:24:37

问题


So, we have a WebRTC enabled app that is actually working in the sense that it's establishing sessions, we're able to connect to them, people are publishing streams, other people are subscribing and unsubscribing to those streams, etc. etc. But we keep getting errors from WebRTC which say 'PeerConnection.getStats. Already getting the stats!' The error occurs in the video stream itself. White text on a black background, instead of the video.

Also, in the console log, we're getting the following errors:

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! 

Any ideas on what might be causing this? How do we turn off PeerConnection from polling stats????? Thanks in advance for any suggestions!


回答1:


I haven't seen this before, but if I were to guess this is probably because you were subscribing multiple times to the same stream before it was done subscribing.



来源:https://stackoverflow.com/questions/18702343/how-do-i-resolve-a-webrtc-peerconnection-getstats-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!