In a world where almost everyone has a smartphone (or any other smart device, e.g. a smartwatch), the customer is spending an increasing amount of time online such as in the web browser or on mobile apps.
Consumer-grade solutions for real-time audio-visual and textual communication are widely available and popular among audiences of all ages. Examples include Apple’s FaceTime, Microsoft’s Skype, Facebook’s Messenger among others. But they all have one disadvantage in common: they all have their own proprietary code and lack interoperability. Since customers all have their own preferences in terms of operating system (e.g. Android, iOS), web browser (e.g. Chrome, Safari, Firefox, Opera) and communication apps, an easy way to establish peer-to-peer real-time communication between them is a hard nut to crack. How are these consumers to be connected?
This is where WebRTC comes into play. It is the name for a framework/standard that extends the web browser, as defined by W3C, that enables two or more peers to communicate with each other in real-time. This standard consists of three main components, namely audio, video and data. WebRTC stands for Web Real-Time Communication; it is an open source project supported by big technology companies such as Google Inc., Mozilla Foundation, Opera Software ASA and Apple Computer Inc.
The technology can already be found in most major browsers, such as Google Chrome, Mozilla Firefox, Microsoft Edge and Opera and on a wide range of platforms. However, WebRTC is aimed at mobile applications as well, or IoT (Internet of Things) devices.
What to expect from WebRTC?
WebRTC supports browser-to-browser applications and includes audio, video and data (Peer-to-Peer), in real-time and without plugins.
Audio
Audio is supported by WebRTC, which is an essential element for e.g. video conferencing. The audio stream is optimised thanks to echo cancellation and noise reduction/repression.
Video
As part of the ‘real-time communication’ promise; WebRTC also include a video stream. A video codec included in VP8, a part of the WebM Project. VP8 is “an open source video coded for the web”. It’s a great choice since the codec allows for efficient compression of the video stream, while retaining a high quality image.
Data
‘Data‘ is quite a broad term. Via a WebRTC session, almost any kind of data can be transmitted between the participants. The ability for sharing arbitrary data via WebRTC datachannels opens a wide range of possible uses. This includes text-based chat, file transfer (sharing documents) or screen-sharing – the possibilities for ‘data’ are virtually endless.
Advantages of WebRTC
Standard
WebRTC is a standard that is being supported and adopted by a number of major technology companies. As such, the technology is already supported in the most popular web browsers used today.
WebRTC relies on open and freely implementable core technologies such as HTML5, JavaScript, HTTP(S) and TCP/IP.
Since it is an open source standard, it is free to use. No license costs need to be paid to any party to start using it; even commercially.
Plug-and-Play
Since WebRTC is directly integrated into the browsers, it does not need any plug-in to function. So it works out of the box, which is great for customer experience. No need for Flash, no need to install extra software. Nobody likes plug-ins and WebRTC delivers.
Platform and Browser Support
WebRTC works on most browsers and platforms. If you use a recent version of Google Chrome or Mozilla Firefox on recent hardware, WebRTC should work right away. Microsoft also introduced WebRTC into their newest Edge browser (available in Windows 10).
Development and Implementation
From a developer point of view, WebRTC is relatively easy to implement. Using the JavaScript API is manageable for most web developers. However, to integrate WebRTC into a native app, certain programming skills are indeed a necessity and a seasoned programmer is required.
Still, an MVP (Minimal Viable Product) can be created in a short amount of time.
Security
Security is an important aspect of WebRTC and as such, WebRTC requires encryption in most cases for it to function. For all WebRTC components, encryption is mandatory.
Since WebRTC runs in the browser, it is sandboxed and can be easily updated to the latest version with a browser update. These days, web browsers are being updated on a regular basis, so this is certainly an advantage for WebRTC.
A plug-in or separate installation would need a separate update process, which the user can more easily forget or skip, ultimately making this kind of solution more vulnerable for security risks. So in general, it is to be expected that WebRTC will be kept up-to-date more easily thanks to its integration with the browser.
Furthermore, while WebRTC is integrated, the camera and microphone are strictly used when the user grants access. It is the end-user who is in the driver’s seat and decides what is being shared and which devices are being used to do so.
Resources Availability
As a result of the open-source nature of WebRTC, many resources are available on the internet. Code samples can be easily found online, as well as documentation and instructional videos.
Disadvantages
Standard
Since WebRTC is still not yet finalised (version 1.0 is not final at this point), each vendor uses their own prefixes and interpretations of the specifications of this standard. As such, there are browser-specific differences which have to be taken into account. Luckily, with the use of the adapter.js JavaScript shim file, there differences can take away there differences and specification interpretations and changes.
Architecture
WebRTC, in its current form, is made for one-to-one conversations and has a range of architectural limitations. In many cases, this is sufficient to cover most uses cases. However, the scope of a project can be broader and multiple peers may be required to participate in the session. An MCU (Multi-point Control Unit) is required to handle multiple peers. The MCU can then, depending on its capabilities, be extend with certain functionalities such as audio and video recording, or make it possible to interact between a browser and VoIP systems.
Browser Support
Some browsers (still) do not (yet) support WebRTC out of the box. A major player in the browser market that lacks WebRTC browser supportat this point includes Internet Explorer, which is a browser that is widely used in work environments and has a significant market share globally. Another example is Safari, the browser from Apple installed by default in the Mac OS X operating system. For these two examples, the end-user still has to install a WebRTC plug-in. This is disadvantageous for the user experience and perception.
These browsers may include WebRTC capabilities in future major releases. For Apple, this may be likely as Apple Computer Inc. is also participating in the development of WebRTC.
Limited Features
WebRTC is cutting-edge technology. In its current form, it only includes a limited number of features. Desktop sharing is available, for example, but only on select number of browsers and only on their latest versions. For these functionalities to be available for older or non-supported browsers, a plug-in is required, ultimately spoiling the user experience.
Numerous WebRTC libraries can fill the gaps when it comes to features. These include inter alia easyRTC, simpleRTC and Holla.
WebRTC on the Technical Side
From the technical point of view, the main concepts in regards to the API of WebRTC include:
- getUserMedia, access to and control of the user’s camera and microphone
- peerConnection, negotiate and connect clients in order to allow direct communication between these parties
- dataChannels, the ability to exchange data P2P.
WebRTC Demo
To test out WebRTC yourself; Google and other parties have made available a number of WebRTC sample/demo pages.
Chances are you are currently running a compatible browser and platform version, so try it out now by using one of the following demo pages which demonstrate some basic or advances capabilities of WebRTC:
- WebRTC JavaScript code samples
- WebRTC Demo via OpenTokRTC
- GoInstant WebRTC Demo
- AppRTC – WebRTC reference app
- Janus WebRTC Gateway Demo Tests
- EasyRTC Demos
- PubNub WebRTC Video Chat Demo
- Qt WebRTC Demo (Uhasselt)
- Temasys WebRTC Samples
Related links: