The video call works fine within the same network. The problem is while calling computer on other network, the remote video doesn't show up. On chrome I don't get any errors in the console, but on firefox console Im getting "ICE Failure".
Im using Node JS for implementing signaling server and Google STUN Server.
Following is the sequence of events im using:
User A:
- Creates Peerconnection (includes getusermedia, addstream)
registers onIcecandidate handler
emits a socket event to notify User B about the call and waits for response
- Receives Offer from User B and creates answer.
User B:
Receives the socket event and creates Peerconnection (includes getusermedia, addstream)
registers onicecandidate handler
- Also registers "Onnegogiationneeded" handler. User A doesn't have this handler. It is removed so that the User B gets enough time to create Peerconnection,candidate handlers and then create an Offer
- When Onnegogiation is triggered, an offer is created and sent to User A
NOTE:
1. Im creating peerconnection and onicecandidate handlers on both sides before creating Offer.
2. It was done to make sure that Onicecandiate handler is ready on both sides much before the offer is created and no ICE Candidates are missed.
Is there anything wrong with the above sequence of events?