Home

Geeklog: What I Learnt Today / Adam

WebRTC is interesting

> I've being doing some work on a WebRTC project to test feasibility of building a custom classroom system, with video and audio chat.

Strengths

WebRTC is quite powerful, in essence you can conduct something like a Skype chat between multiple people just using standard web browsers without any plugins or add ons.
So it has the potential to be very widely usable. You don't have to install a program on the users computer so you can skip operating system issues and you don't need a IT administrator to be involved if the users are in a school or university where installing programmes is restricted. Installing something on a users computer before the can take part in a chat is at best an inconvenience and a source of friction.
Your saved the work of supporting multiple operating systems and developers who build the programmes. Its also the future so more and more devices and browsers should support it.

Weaknesses

Fundamentally your restricted to the browser so integrating with the users computer outside of the browser box for something like screen sharing or sharing access to an application is cut off. You can create extensions or plugins to enable screen sharing.
The user also has to allow their browser to share the video and sound from their system. You prompt them and they click to allow all or in some browsers just a single part sound or video.
This shows another potential downside your restricted by browsers some what, you don't have to have the latest shiniest but you need something reasonably up to date. Google Chrome, Firefox work ok, and I think Edge. Unfortunately as you may have noticed those don't include Safari which restricts iPhone and iPad access. I've not found a why to this it just seems to be something Apple don't want to enable, yet. Some plugins exist that claim to enable WebRTC in the deficient browsers. whilst this seems negative I think more widespread support will emerge in the future. There is a browser support page here http://iswebrtcreadyyet.com/.


Mostly communication is peer to peer with some negotiation STUN (Session Traversal Utilities for NAT) server if that doesn't work because of network topology then your forced to use a TURN server. This is not so shiny as it means you using the TURN server to relay message between chat members, this is a potential source of delays and processing demand on the TURN server your running. In my testing though I was able to use just the STUN server, I guess the TURN server would be more likely to need to used when one of the chat members was inside a large organisation. Its worth while considering the peer to per nature of the communication if you want to record chats as the data may not go through a central point where you can push it to a file.
Handling between browsers varies slightly so you may want to use a framework that abstracts that away somewhat I used Simple WebRTC (https://simplewebrtc.com/). there are also services that offer WebRTC or parts as a service that you can than integrate into a wider application, if you want to find out more about to about the JavaScript its worth looking at the work of Muaz Khan at https://www.webrtc-experiment.com/.
Ultimately I build a demo system in order to demonstrate feasibility and then stopped as there wasn't the budget at that point. Perhaps at some point that project will happen but its always useful to know what is and isn't feasible and what the limits of a technology are to use in others.

/ Adam