WebRTC dataChannel.readyState stalling on “connecting”

大兔子大兔子 提交于 2020-01-07 02:56:26

问题


I'm trying to understand how to use WebRTC dataChannels, but having some issues just testing them.

I cloned https://github.com/JustGoscha/simple-datachannel but it doesn't seem to function. The offer is made, processed and responded to, but the dataChannel.readyState seems to stick to 'connecting'.

I was able to get Video/Audio working just fine over LAN with this: https://github.com/shanet/WebRTC-Example So I know my issue isn't NAT related (there are no TURN servers in that example).

Just to confirm, I edited the first example changing line 94 of dc.html and index.html to an empty array for "iceServers" to avoid any connection issues over LAN.

I'm trying to find working implementations of a dataChannel without multiple frameworks or abstractions stacked on top ( I want to learn how to use them and how they work ), but I can't seem to wrap my head around the issues I'm having.


回答1:


That particular example has not been updated for more than two years and uses the nonstandard rtp data channels which have recently been forcefully deprecated by Chrome.

https://webrtc.github.io/samples/ has multiple example of datachannels without using a framework. The samples only use the adapter.js polyfill in order to allow writing code that complies to the standard (which is still in a state of flux).



来源:https://stackoverflow.com/questions/35104933/webrtc-datachannel-readystate-stalling-on-connecting

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