如何解决 WebRTC PeerConnection.getStats 错误? [英] How do I resolve a WebRTC PeerConnection.getStats error?

查看:64
本文介绍了如何解决 WebRTC PeerConnection.getStats 错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我们有一个支持 WebRTC 的应用程序,它实际上正在建立会话,我们能够连接到它们,人们正在发布流,其他人订阅和取消订阅这些流,等等.. 但是我们不断收到来自 WebRTC 的错误消息,上面写着PeerConnection.getStats".已经拿到统计数据了!错误发生在视频流本身.黑色背景上的白色文本,而不是视频.

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! 

对可能导致这种情况的原因有任何想法吗?我们如何从轮询统计中关闭 PeerConnection????提前感谢您的任何建议!

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

推荐答案

我以前没见过这个,但如果我猜这可能是因为您在订阅完成之前多次订阅同一个流.

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.

这篇关于如何解决 WebRTC PeerConnection.getStats 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆