I am very much tired of this issue and getting frustrated. I am trying to implement a peer-to-peer video call. My RTCPeerConnection
is something like this :
const configuration = { iceServers: [{ url: 'stun:stun.l.google.com:19302' }] };
const peerConnection = new RTCPeerConnection(this.configuration);
peerConnection.onicecandidate = e => {
try {
console.log('remotePC icecandidate:', e.candidate);
// if (e.candidate) {
// peerConnection.addIceCandidate(e.candidate);
// }
} catch (err) {
console.error(`Error adding localPC iceCandidate: ${err}`);
}
};
This onicecandidate
event is not firing. That’s why I can’t exchange candidate between peers through my server. My server is running locally. Also, I have set local description and remote description successfully.
Any working example would be very helpful to me. Thanks in advance.