I am trying to implement WebRTC call in js but I am not sure why this weird thing happens.
My question is exactly like this question. But the answers don't fix it in my case and I am using the latest FF and Chrome browsers.
This is what happens:
Peer A sends OFFER to Peer B.
Peer B sends back ANSWER to Peer A.
Peer B sends OFFER to Peer A.
Peer A sends back ANSWER to Peer B.
What my debugging suggests is that when Peer B executes this below code a negotiationneeded
event is fired which in my understanding shouldn't happen.
const answer = await myPeerConnection.createAnswer();
await myPeerConnection.setLocalDescription(answer);
When Peer A has answered to the Peer B's offer call works.
In nutshell, the caller has to become callee for the call to work.
If you need more code please let me know.