2

I am using simple peer for my video call web application. when I call people in the same network video call is working perfectly. But in the different networks, it is not working. I also added ICE servers(stun/turn) to simple peer. Still, the same issue is happening can anyone please help me out. I am getting this issue in the console

Error: Connection failed. at h (index.js:17)at f.value (index.js:654) at RTCPeerConnection.t._pc.onconnectionstatechange (index.js:119)

const peer = new Peer({
  initiator: true,
  trickle: false,
  stream,
  config: {

    iceServers: [
        {
            urls: "stun:numb.viagenie.ca",
            username: "************",
            credential: "************"
        },
        {
            urls: "turn:numb.viagenie.ca",
            username: "************",
            credential: "************"
        }
    ]
}
});
yoonus
  • 41
  • 7

2 Answers2

0

I had facing through the same issue.

I'm not sure if that has to do with those specific iceServers but I replace them with this ones on it works

iceServers: [
    { urls: 'stun:stun.l.google.com:19302' },
    { urls: 'stun:stun1.l.google.com:19302' },
    { urls: 'stun:stun2.l.google.com:19302' },
    { urls: 'stun:stun3.l.google.com:19302' },
    { urls: 'stun:stun4.l.google.com:19302' },
    {
      url: 'turn:turn.bistri.com:80',
      credential: 'homeo',
      username: 'homeo',
    },
    {
      url: 'turn:turn.anyfirewall.com:443?transport=tcp',
      credential: 'webrtc',
      username: 'webrtc',
    },

Everything is working good but now my problem is that safari is not working just chrome with iOS

If someone knows how to handle this compatibility please contact me! :D

Cesar Moran
  • 123
  • 1
  • 9
0

my issue here was with the stun/turn server.we can check the status of servers using https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/

If you test a STUN server, it works if you can gather a candidate with type "srflx". If you test a TURN server, it works if you can gather a candidate with type "relay".

check you are getting this

yoonus
  • 41
  • 7