WebRTC (Web Real-Time Communication) is an awesome new tech for video/audio chat directly inside your browser or mobile app. The best of its kind. But like many new technologies, it has some nasty pitfalls even for the experienced developers.
Today, I’ll explain what is WebRTC, share the story of our Web RTC application and tell you how to avoid the three mistakes that can easily destroy your video chat project:
The story starts early February 2018.
On a cold rainy evening, a man appeared in front of our office. He was dressed in a gray trench coat and a rain-soaked fedora. The man’s name was [Redacted]. As we invited him to take shelter in the warmth of our server room, he made us an offer we couldn’t refuse.
We can’t, of course, tell you the exact nature of that offer. You see, he wanted us to implement a [Redacted] feature in his [Redacted] application. Well, you can think of it as a real-time video-chat. For spies.
Video conferences are planned for the next release; credit: Kingsman: the Secret Service
After a short discussion, we’ve chosen the perfect technology for the task – Web RTC.
It allows direct communication between browsers or mobile apps. Among the WebRTC examples are such apps as Google Hangouts, Facebook Messenger, and Discord.
What WebRTC is used for besides adding video/audio chat to apps and websites is:
Unlike previous solutions, it doesn’t require any plugins (e.g. Flash) or additional software.
It is free. It’s open source. It works in most modern browsers.
The whole feature was estimated to take less than 60 hours. But as soon as we got to the bottom of it, things got so much complicated.