pusher_webrtc icon indicating copy to clipboard operation
pusher_webrtc copied to clipboard

How to add Stun/Turn server

Open BaBaSwan opened this issue 5 years ago • 1 comments

How to add the Stun/Turn server to this program?

I still have problem in showing the videos of both sides and I get these two errors:

  1. InvalidStateError: Cannot add ICE candidate in state stable

  2. ICE failed, add a STUN server and see about:webrtc for more details

BaBaSwan avatar Apr 03 '19 13:04 BaBaSwan

Hi, function prepareCaller() { const configuration = { 'iceServers': [{ 'urls': 'stun:stun.l.google.com:19302' }] }; //Initializing a peer connection caller = new window.RTCPeerConnection(configuration); //Listen for ICE Candidates and send them to remote peers caller.onicecandidate = function(evt) { if (!evt.candidate) return; console.log("onicecandidate called"); onIceCandidate(caller, evt); }; Good Luck:)

ghost avatar Feb 15 '20 16:02 ghost