TwilioJesse Sumrak11 min readtutorialintermediate
How to Get Started With WebRTC: Intro to Browser APIs
Summary
The article walks through the three core WebRTC browser APIs—getUserMedia, RTCPeerConnection, and RTCDataChannel—showing a minimal camera preview example and explaining the need for signaling, STUN/TURN, and Twilio’s network traversal service. It also points readers to Google’s codelab and sample code for building real‑time video and data apps.
- getUserMedia works only on HTTPS or localhost; the snippet shows how to display a webcam stream in a <video> element.
- RTCPeerConnection requires you to implement your own signaling (e.g., WebSocket) to exchange offers, answers, and ICE candidates.
- NAT traversal relies on free STUN servers and paid TURN relays; Twilio offers globally distributed STUN/TURN services.
- RTCDataChannel lets peers exchange arbitrary ordered or unordered data without routing through a server.
Engineers building browser‑based voice, video, or data‑rich apps need a practical intro to the WebRTC APIs and the surrounding infrastructure they must provide.
6/10



