Free up to 1MM monthly messages. No credit card required.
WebRTC (Web Real-time Communications) enables peer to peer video, audio, and data communication between two web browsers. This allows for video calling, video chat, and peer to peer file sharing entirely in the web browser, with no plugins.
It is entirely peer to peer, so you don’t have to pay for any of the bandwidth across the wire. Additionally, because it is entirely browser to browser, you get the highest performance and lowest latency possible. For example, say a user is trying to share a file. Without it, the user has to upload said file to a server, and the recipient user has to download that file. With it, these files are transferred directly through the WebRTC Data Channel, no servers or infrastructure required.
WebRTC works by connecting two browsers through the RTCPeerConnection. First, the browsers are connected through signaling, by passing the Session Description Protocol (SDP). This signaling discovers where the two users are and how to connect. Once the RTCPeerConnection is open, video, audio, and data communication can be sent between the two browsers.
To make it work, all you need is two web browsers and a way to transfer a SDP between them. The SDP includes information about your computer, what audio codecs you support, how you can transmit data between computers, and what ports are available on your computer that you can connect to. You can read more about SDPs here.
Think of SDPs like business cards. You exchange them with somebody else, and now you know how to contact each other. Because methods of transferring SDPs are not detailed in the specification, you have to provide your own signaling implementation. This is done by implementing your own way to transfer the SDP data.
Right now, WebRTC is compatible with Chrome, Firefox and most recently Opera, on both desktops and Android devices (this includes interoperability between the two). Internet Explorer and Safari have remained silent so far, but are expected to have implementations in the near future.
So where does PubNub fit into this? You need some way to transfer the SDP from browser A to browser B. The PubNub Data Stream Network can be used as a scalable signaling server for these apps. PubNub features, such as Presence and Storage/Playback also can be used to enhance those apps.
When calling another user through a WebRTC app, the caller needs to know if the callee is currently online or offline and what device they’re using, if they’re available to accept the call, etc. PubNub Presence gives you all that information and enables you to show the users they can connect with. This is essential for signaling, to prevent users from trying to connect to other users that aren’t available.
The WebRTC protocol does not provide storage capabilities, and as a result, there are no records of what messages have been sent. Specifically with text chat, users expect a history of previous chat conversations. PubNub’s Storage/Playback feature allows users to see a history of past conversations over a desired period of time.
Because WebRTC enables voice, video, and data communication, there are many use cases, ranging from basic video/voice chat to multiplayer gaming to file sharing and so on.
With WebRTC, video and voice communication can be easily implemented into any website. This adds advanced levels of interaction to a website, allowing users to communicate in-context and in real time, with either site operators or with each other. Such capabilities are more desirable than current limitations whereby users need to call a number, download a plugin, or leave your website. For example, a financial institution website could easily embed a WebRTC communication app to allow users to quickly speak to a financial representative (rather than forcing them to use their phone to endlessly talk with an automated representative).
The Data Channel eliminates the need to upload files to cloud services, such as Dropbox or Google Drive, to perform file transfers or share with others. Similar to these cloud services, the Data Channel allows users to transfer large amounts of data very quickly, all in the web browser in true peer to peer fashion. Check out PubShare, a peer to peer file transfer application powered by WebRTC and PubNub.
Universal remote control applications are another interesting implementation of the Data Channel. Smartphones use the RTCDataChannel to connect to SmartTVs, and this allows users to send data packets between the two devices (for example, this data can then be used to send instructions such as pausing or playing a streaming audio or video service). Anything in a web browser can easily be controlled by utilizing the data channel.
Patrick Ng, Innovation Director at Spark Launchpad, joins Casey Clegg, COO at PubNub, to discuss effective ideation and the...
A roundtable discussion led by PubNub’s COO, Casey Clegg, exploring the topics of what it means to be human in a virtual world.
Dr. Joe Kvedar, Chair of the Board for the American Telemedicine Association, joins our COO, Casey Clegg, to discuss why...