So, i'm trying to build a webrtc video chat
web app using peer.js
. So far so good, everything seems to work right.
The problem starts when i run my app on my private server.
Everytime i try to answer or make a call the video starts playing for a few seconds, but with black screen, and then i get the ICE Failed
error and it disconnects.
This wont happen if the two users share the same ip address. If the users share the same ip the video chat works fine and there is no problem at all.
What could be the problem here?
UPDATE
i added stun and turn server on peer but i get the same error again
peer = new Peer({ key: peerApiKey, debug: 3, config: {'iceServers': [
{ url: 'stun:stun.l.google.com:19302' },
{ url: 'stun:stun1.l.google.com:19302' },
{ url: 'turn:numb.viagenie.ca:3478', credential: 'muazkh', username:'webrtc@live.com' },
{ url: 'turn:numb.viagenie.ca', credential: 'muazkh', username:'webrtc@live.com' },
{ url: 'turn:192.158.29.39:3478?transport=udp', credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=', username:'28224511:1379330808' },
{ url: 'turn:192.158.29.39:3478?transport=tcp', credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=', username:'28224511:1379330808' }
]}});