Reputation: 263
I am testing my webrtc application with localhost... It is the weirdest thing. Sometimes it connects perfectly, displaying both local and remote video on both of my windows.
Sometimes on one of the windows it can't display the remote video properly, so the remote video is just "stuck" on one image, and isn't "moving". It's frozen I guess, but the other window can still receive the remote video just fine. So it's like a one sided connection.
Sometimes, the webrtc
doesn't even connect at all.
I have gotten all of these things happen, BUT the code is the same. Why is webrtc
so weird?
Has anyone else had the same problems?
Upvotes: 1
Views: 1004
Reputation: 4750
You are touching the main issue with P2P protocol, as you need your two peer to connect to each other ( sound simple, but it is complex on the internet ).
It really depend on your network topology between your two computer.
Peer 1 --- Peer 2
this situation is perfect as there is no obstacle for 1 to connect to 2 and vice versa
Peer 1 --- Router --- Peer 2
You everyday situation on the internet, the ability for 1 to connect to 2 heavily depend on your router configuration (and more than often, you don't control the configuration of the routers that are in between). To overcome that situation there was multiple solution that were developed :
I real world scenario, peer to peer network rely on supernode to relay traffic in such case, there is nosuch thing for webRTC (except if you count Turn servers), as they would need to carry the charge of realtime video/audio traffic wich could be heavy when scaled to a lot of client.
Upvotes: 1