PeerJS无法使用转弯服务器

时间:2018-08-17 17:58:45

标签: webrtc stun turn peerjs

我正在使用peerJS,

在LAN上一切正常,但是如果我通过手机连接使用转弯服务器,则流连接失败。

mediaStream在peerJS连接中传递。on('stream',(stream)=> {。 但是在此之后崩溃,问题似乎与眩晕/转弯协商有关,在此控制台日志中:

.callConnection.on('stream')... <-- I receive the stream

...

PeerJS:  Set remoteDescription: ANSWER for: PEER_ID
PeerJS:  Added ICE candidate for: PEER_ID 
PeerJS:  iceConnectionState is disconnected, closing connections to PEER_ID 
    myHandler.Negotiation of connection to PEER_ID failed.

然后发现此错误:

Error: Negotiation of connection to PEER_ID failed.
    at RTCPeerConnection.pc.oniceconnectionstatechange [as onicechange] 

这里失败了

那会是什么?

我不确定是否重要,在信令协商日志中我看不到配置的TURN IP,我只看到其他IP:

{"type":"CANDIDATE","src":"itEthicsoftIdeskUserUUU1","dst":"itEthicsoftIdeskDeviceDDDfa53da20-5cc8-83dc-e259-df0ef328fbb7","payload":{"candidate":{"candidate":"candidate:1028452565 1 udp 2113937151 10.98.5.173 42892 typ host generation 0 ufrag lewL network-cost 50","sdpMid":"audio","sdpMLineIndex":0},"type":"media","connectionId":"mc_yzox790yv9b"}}
{"type":"CANDIDATE","src":"itEthicsoftIdeskUserUUU1","dst":"itEthicsoftIdeskDeviceDDDfa53da20-5cc8-83dc-e259-df0ef328fbb7","payload":{"candidate":{"candidate":"candidate:842163049 1 udp 1677729535 37.162.11.125 44523 typ srflx raddr 10.98.5.173 rport 42892 generation 0 ufrag lewL network-cost 50","sdpMid":"audio","sdpMLineIndex":0},"type":"media","connectionId":"mc_yzox790yv9b"}}

预先感谢

0 个答案:

没有答案