WebRTC is an almost magical idea: Browser-based real-time communication baked into the emerging HTML5 standard so users can call each other and video chat without the need of a plugins or third-party software.
If agreed upon and widely adopted, WebRTC (the RTC stands for “real-time communication”) will make it really simple for websites and applications to incorporate voice calling, video chat and P2P file sharing the way it now is a breeze to adjust line spacing on a blog post.
WebRTC still is an API definition in the works, with the W3C mailing list for the technology launched just last year and the official HTML5 specification still being hammered out for at least another few years, if not longer. And there is a competing standard offered up by Microsoft, CU-RTC-Web. But WebRTC is supported by Google, Mozilla and Opera, and the technology in an early form already has made it into the likes of Google Chrome.
“Achievement of Real Time communication has become very simple with the help of our buddy ‘HTML5,’” wrote software developer Sandeep Sunku for CodeProject. “As you know, even the latest Google hang up uses gtalk plugins to achieve video chat. But this Web RTC provides a clean approach to achieve Video chat without much difficulty and without intervention of any third party plugins or modules.”
To achieve video chat, the web application goes through three stages: It fetches the video stream from the connected video device of the initiating user, fetches a session description protocol (SDP) by connecting to Google STUN server, and exchanges the SDP with the person being called by using a Web socket server.
“Web RTC provides very good and interesting APIs to fetch the video stream from the connected video device,” wrote Sunku.
Details like IP address and video format are handled with the SDP, which can be obtained by connecting with the Google STUN server using the webkitPeerConnection API.
“Once the SDP message is received, then the message is sent to the peer using websocket server. This process is known as ‘Signaling’, wrote Sunku. “Signaling is not a part of WebRTC. You need to select or find the way to handshake between peers using some means.”
Sunku selected web socket server for signaling in his example because it is a new HTML5 feature that provides good performance.
“Web socket server is the one who takes care of signaling part,” he noted. “It receives messages from the peers and sends messages to the peers. HTML5 has full support for websocket features and one main advantage of websocket server is, the connection is persistent.”
He added that each day is a revolution in the technology sector, and WebRTC is just that—a revolution in the making when it comes to multimedia and real-time communication.
Edited by Rich Steeves