APIs of Web Real-Time Communication (WebRTC)

Thanusri swetha J October 20, 09:50 AM Technology

Web Real-Time Communication (WebRTC) is both an open-source project and specification that enables real-time media communications like voice, video and data transfer natively between browsers and devices. This provides users with the ability to communicate from within their primary web browser without the need for complicated plug-ins or additional hardware.

The WebRTC project was first announced by Google in May 2011 as a means of developing a common set of protocols for enabling high-quality RTC applications within browsers, mobile platforms and IoT devices. At the time, Flash and plug-ins were the only methods of offering real-time communication. [1]

Figure 1. the web real-time communication (WebRTC)

Figure 1 shows the Web Real-Time Communications (WebRTC) is an open-source video project that is capable of streaming with real-time latency. This project was developed to support VoIP, and it was purchased by Google to support Google’s video chatting tools.

WebRTC is technically a streaming project and not a streaming protocol. However, it is often lumped in with the preferred protocols since there is a lot of overlap.[2]

WebRTC APIs

There are 3 primary components of the WebRTC API and each plays a unique role in WebRTC specification:

MediaStream (GetUserMedia):

The Media Stream API provides a way to access device cameras and microphones using JavaScript. It controls where multimedia stream data is consumed and provides some control over the devices that produce the media. It also exposes information about devices able to capture and render media.

RTC PeerConnection:

The Peer Connection is the core of the WebRTC standard. It provides a way for participants to create direct connections with their peers without the need for an intermediary server (beyond signaling). Each participant takes the media acquired from the media stream API and plugs it into the peer connection to create an audio or video feed. The PeerC onnection API has a lot going on behind the scenes.

RTCDataChannel:

The RTC Data Channel API was set up to allow bi-directional data transfer of any type of data - media or otherwise - directly between peers. It was designed to mimic the WebSocket API, but rather than relying on a TCP connection which although reliable is high in latency and prone to bottlenecks, data channels use UDP-based streams with the configurability of the Stream Control Transmission Protocol (SCTP) protocol.[1]

A few things worth mentioning:

  • WebRTC is completely free
  • It comes as open source project that has been embedded in browsers but you can take and adopt it for your own needs
  • This in turn has created a vibrant and dynamic ecosystem around WebRTC of a variety of open source projects and frameworks as well as commercial offerings from companies that help you to build your products
  • WebRTC constantly evolving and improving, so you need to keep an eye on it (e.g. see WebRTC ports)[3]
References:
  1. https://www.liveswitch.io/ultimate-guide-to-webrtc
  2. https://www.dacast.com/blog/video-streaming-protocol/
  3. https://bloggeek.me/what-is-webrtc/
Cite this article:

Thanusri swetha J (2021), Web Real-Time Communication (WebRTC), Anatechmaz, pp. 18

Recent Post

Blog Archive