WebRTC Crash Course
Why Stack Overflow recommends it
Stack Overflow users link it when answering or asking about WebRTC connectivity, especially to explain what STUN, TURN and ICE do and how to wire up a peer connection by hand.
Recommended by 3 people across 3 different months, 2021 to 2023.
What it is
A 70-minute crash course by Hussein Nasser on WebRTC covering NAT and its translation methods, STUN, TURN, ICE, SDP and signaling, followed by a hands-on demo that opens a peer connection between two browser tabs. It ends with the pros and cons of WebRTC.
What people said
Recommends Ajith Kumar · 2021-10 · Stack Overflow · on “Flutter video chat using WebRTC always getting RTCPeerConnectionStateFailed state”
I did some tinkering and further digging. Various sources helped. The following factors lead me to the solution. I added some delays in Exchanging ICE Candidates. This helped me in improving call connection success. (ie, if I make 10 calls, initially 3 times doctor could see both feeds, patient could see only his feed. With the delays being introduced, the success rate is now 8 out of 10 calls). I changed the order in which I did set streams and created offer or answers. Before creating Offer, I set local streams. I made sure all callbacks were set, before any offers were created. Finally, I moved the processWSMessage callback registraion to after all other callbacks were set. All the above
Recommends Usama · 2022-01 · Stack Overflow · on “Webrtc video streaming working properly in localhost but not working in production (using google turn server)”
stuns server is only used to get you public ip it won't help you to traverse nat and firewall you will need a turn server for that . seems that you don't have clear understanding of webrtc you can watch this video to get more clear picture of why you application is failing on server [this video]
Recommends Broteen Das · 2023-04 · Stack Overflow · on “what is STUN stun.l.google.com:19302 used for”
A STUN server basically tells you what your public IP is. (In a nutshell) Explanation: When collecting ICE Candidates (or the ways to connect to a peer), the WebRTC code collects all possible ways of connecting to a peer. Connecting via the WAN is one of those ways (or candidates). So in order to know what public IP address is assigned to a device by its router (applicable for Full Cone NAT), STUN servers tell you just that. I recommend reffering to this video [this video] for a lucidly beautiful explanation.
Cites Skin_phil · 2021-04 · Stack Overflow · on “when using WEBRTC to stream video between peers, ontrack function is never called”
I am doing a video chat, and in the first steps i am trying to deeply understand WEBRTC. I'm not to the signalling part yet, so I am doing it 'by hand' as shown here [this video] ,Then i get a stream from the navigator and create an offer which I manually paste in the other peer. Then I create an answer and repeat the process the other way around. The add track function seems to work without a problem, but the function ontrack is never called in the other peer. here is the code I wrote for the 'main' peer, even looping in the streams tracks and adding them one by one doesn't work navigator.mediaDevices.getUserMedia( { video: true, audio: true }).then(stream => { document.getElementById('video').s
Cites Ahmed Boutaraa · 2021-11 · Stack Overflow · on “ICE vs STUN vs TURN”
This answer is for someone new to WebRTC. Before we dive into the difference between STUN ( Session Traversal Utilities for NAT ) and TURN ( Traversal Using relays around NAT ), we need to understand how two deceives/peers can communicate via NAT [LINK] ( Network address translation ) and its different methods: Full-cone NAT , also known as one-to-one NAT, and less secure where anyone can connect to you and send data. (Address)-restricted-cone NAT , sender IP address must match with one of your NAT table visitors addresses. Port-restricted cone NAT , like address-restricted-cone NAT, but the restriction includes port numbers. Symmetric NAT , allow a full-pair match only, most secure but not
Cites brio97 · 2022-07 · Stack Overflow · on “WebRTC: ICE failed in Firefox, but working in MS Edge”
I want to develop a WebRTC based streaming application and I am learning about the protocol starting from the basics. In particular, I followed this extremely simple example on GitHub [LINK] (also shown in this [this video] ) that just opens a WebRTC channel between two browser tabs, and was able to run it on Microsoft Edge in my local machine. However, if I use the same JavaScript code in Firefox (version 102.0 on Windows 11), I receive an error WebRTC: ICE failed, add a STUN server and see about:webrtc for more details on both sender and receiver tabs. I have therefore tried to include the STUN, TURN and TURNS servers provided by Open Relay [LINK] in the configuration, but the same error messag