I followed the below link and able to implement point-to-point video calling. But, it is working in the same network environment and not working between two different networks. Please suggest a solution to solve this issue.
navigator.mediaDevices.getUserMedia(constraints)
.then(gotStream)
.catch(function (e) {
alert('getUserMedia() error: ' + e);
});
gotStream: function (stream) {
console.log('Adding local stream.' + isInitiator);
localVideoConnected.src = window.URL.createObjectURL(stream);
localStream = stream;
sendMessage('got user media');
if (isInitiator) {
maybeStart();
}
},
maybeStart: function () {
isChannelReady);
if (!isStarted && typeof localStream !== 'undefined' && isChannelReady) {
console.log('>>>>>> creating peer connection');
createPeerConnection();
pc.addStream(localStream);
isStarted = true;
console.log('isInitiator', isInitiator);
if (isInitiator) {
doCall();
}
}
}
doCall: function () {
console.log('Sending offer to peer');
pc.createOffer(setLocalAndSendMessage, handleCreateOfferError, sdpConstraints);
},
pc.createOffer(setLocalAndSendMessage, handleCreateOfferError, sdpConstraints);
setLocalAndSendMessage: function (sessionDescription) {
console.log('---------------SET LOCAL SDP AND SEND----------');
pc.setLocalDescription(sessionDescription);
console.log('setLocalAndSendMessage sending message', sessionDescription);
sendMessage(sessionDescription);
},
handleCreateOfferError: function (event) {
console.log('createOffer() error: ', event);
}
creating peer connection webrtc.controller.js:102:21
Created RTCPeerConnnection webrtc.controller.js:120:21
isInitiator true webrtc.controller.js:106:21
Sending offer to peer webrtc.controller.js:147:17
setLocalAndSendMessage sending message RTCSessionDescription { type: "offer", sdp: "v=0 o=mozilla...THIS_IS_SDPARTA-47.…" } webrtc.controller.js:163:17
Client sending message: RTCSessionDescription { type: "offer", sdp: "v=0 o=mozilla...THIS_IS_SDPARTA-47.…" } webrtc.controller.js:77:17
icecandidate event: icecandidate { target: RTCPeerConnection, isTrusted: true, candidate: RTCIceCandidate, currentTarget: RTCPeerConnection, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, timeStamp: 1469439589615000, originalTarget: RTCPeerConnection, explicitOriginalTarget: RTCPeerConnection } webrtc.controller.js:129:17
Client sending message: Object { type: "candidate", label: 0, id: "sdparta_0", candidate: "candidate:0 1 UDP
2122187007 192.16…" } webrtc.controller.js:77:17
icecandidate event: icecandidate { target: RTCPeerConnection, isTrusted: true, candidate: RTCIceCandidate, currentTarget: RTCPeerConnection, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, timeStamp: 1469439589619000, originalTarget: RTCPeerConnection, explicitOriginalTarget: RTCPeerConnection } webrtc.controller.js:129:17
Client sending message: Object { type: "candidate", label: 0, id: "sdparta_0", candidate: "candidate:1 1 UDP
2122252543 192.16…" } webrtc.controller.js:77:17
icecandidate event: icecandidate { target: RTCPeerConnection, isTrusted: true, candidate: RTCIceCandidate, currentTarget: RTCPeerConnection, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, timeStamp: 1469439589624000, originalTarget: RTCPeerConnection, explicitOriginalTarget: RTCPeerConnection } webrtc.controller.js:129:17
Client sending message: Object { type: "candidate", label: 0, id: "sdparta_0", candidate: "candidate:0 2 UDP
2122187006 192.16…" } webrtc.controller.js:77:17
icecandidate event: icecandidate { target: RTCPeerConnection, isTrusted: true, candidate: RTCIceCandidate, currentTarget: RTCPeerConnection, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, timeStamp: 1469439589627000, originalTarget: RTCPeerConnection, explicitOriginalTarget: RTCPeerConnection } webrtc.controller.js:129:17
Client sending message: Object { type: "candidate", label: 0, id: "sdparta_0", candidate: "candidate:1 2 UDP
2122252542 192.16…" } webrtc.controller.js:77:17
icecandidate event: icecandidate { target: RTCPeerConnection, isTrusted: true, candidate: RTCIceCandidate, currentTarget: RTCPeerConnection, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, timeStamp: 1469439589630000, originalTarget: RTCPeerConnection, explicitOriginalTarget: RTCPeerConnection } webrtc.controller.js:129:17
Client sending message: Object { type: "candidate", label: 1, id: "sdparta_1", candidate: "candidate:0 1 UDP
2122187007 192.16…" } webrtc.controller.js:77:17
icecandidate event: icecandidate { target: RTCPeerConnection, isTrusted: true, candidate: RTCIceCandidate, currentTarget: RTCPeerConnection, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, timeStamp: 1469439589632000, originalTarget: RTCPeerConnection, explicitOriginalTarget: RTCPeerConnection } webrtc.controller.js:129:17
Client sending message: Object { type: "candidate", label: 1, id: "sdparta_1", candidate: "candidate:1 1 UDP
2122252543 192.16…" } webrtc.controller.js:77:17
icecandidate event: icecandidate { target: RTCPeerConnection, isTrusted: true, candidate: RTCIceCandidate, currentTarget: RTCPeerConnection, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, timeStamp: 1469439589635000, originalTarget: RTCPeerConnection, explicitOriginalTarget: RTCPeerConnection } webrtc.controller.js:129:17
Client sending message: Object { type: "candidate", label: 1, id: "sdparta_1", candidate: "candidate:0 2 UDP
2122187006 192.16…" } webrtc.controller.js:77:17
icecandidate event: icecandidate { target: RTCPeerConnection, isTrusted: true, candidate: RTCIceCandidate, currentTarget: RTCPeerConnection, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, timeStamp: 1469439589637000, originalTarget: RTCPeerConnection, explicitOriginalTarget: RTCPeerConnection } webrtc.controller.js:129:17
Client sending message: Object { type: "candidate", label: 1, id: "sdparta_1", candidate: "candidate:1 2 UDP
2122252542 192.16…" } webrtc.controller.js:77:17
icecandidate event: icecandidate { target: RTCPeerConnection, isTrusted: true, currentTarget: RTCPeerConnection, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, timeStamp: 1469439589640000, originalTarget: RTCPeerConnection, explicitOriginalTarget: RTCPeerConnection, NONE: 0 } webrtc.controller.js:129:17
End of candidates. webrtc.controller.js:138:21
Client received message: Object { type: "answer", sdp: "v=0 o=mozilla...THIS_IS_SDPARTA-47.…" } -- true webrtc.controller.js:461:13
Remote stream added. webrtc.controller.js:202:17
Client received message: Object { type: "candidate", label: 0, id: "sdparta_0", candidate: "candidate:0 1 UDP
2122252543 192.16…" } -- true webrtc.controller.js:461:13
ICE failed, see about:webrtc for more details (unknown)
Please do the needful.
Venkat.