What TURN Relay Does in WebRTC Video Playback
Understand how TURN relays media when direct WebRTC connectivity fails and what bandwidth costs mean in production.
Short answer
TURN is not a playback protocol; it is a relay service used when direct WebRTC connectivity fails. It improves connectivity but consumes server bandwidth.
Where it sits in a video pipeline
WebRTC first tries direct connectivity. When that fails, media is relayed through a TURN server.
How to use it in a browser project
The frontend configures TURN URL, username and password in iceServers. Users do not enter turn: as a video playback URL.
What the server has to do
The server must provide TURN credentials, port strategy, TLS/UDP/TCP support and bandwidth capacity planning.
Common development scenarios
- Enterprise networks, mobile networks, strict NAT and cross-region WebRTC playback.
Debugging order
- If only some users cannot play, inspect TURN credentials, ports, firewall rules and bandwidth limits.
Recommended conversion paths
- TURN does not transcode or remux; it only relays WebRTC media.
Minimum usable implementation
- Frontend: put TURN into WebRTC iceServers.
- Backend: issue short-lived credentials and monitor relay bandwidth and failure rate.
Developer decision rule
TURN should be judged by its role in the delivery chain, not by the protocol name alone. Browser result: Not a media format, a relay service. Before promising playback, confirm the source type, whether a server conversion is required, CORS and HTTPS policy, codec support and the latency target.