I am using webRTC for sharing video between two computers. The problem I have is that sometimes it does not work, but usually, it does work. I think my companies firewall is breaking the connection, but I have no way of knowing why the video just does not show up. I always successfully send the SDP and Ice candidates, but then just nothing happens. The audio/video tracks are never received. I have access to both browsers code, so if there is anything I could add code-wise to tell me why a connection is not received that would be great. I will show you guys my code if you want, but I am more hoping to know what spots would need a console.log() to know SDP candidates are bad
sort of thing. I am using Twilio for the stun and Turn server.
Asked
Active
Viewed 587 times
1

Samuel Thompson
- 2,429
- 4
- 24
- 34
-
If you think it is because of company firewall, then hook the oniceconnectionstatechange callback to see if the ice failure happens, Just to confirm once. https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/oniceconnectionstatechange – Karthik Apr 09 '20 at 20:26
-
@karthik I have hooked that up. I actually log all events that fire – Samuel Thompson Apr 13 '20 at 21:40
-
Could be a couple of things. If you want to circumvent company firewalls, running a TURN-Server with TCP transport mode and listening on port 80 can help, but I assume the firewall would block not just some, but all transmissions. Another reason could be glare (both sides send SDP offers at the same time). But Glare and setting SDP in the wrong state will usually result in a console error from `setLocalDescription(offer)`. Have a look at the state-attributes of the RTCPeerConnection (iceGatheringState, iceConnectionState and signalingState) and check if they behave expected – nasskalte.juni Apr 16 '20 at 15:52