What sort of services does PubNub provide with respect to WebRTC and video chat?

Before we get started here please review 3 Things WebRTC Can Not Do.

We get this question quite frequently because many struggle to understand the role that PubNub plays in WebRTC and video chat applications. So we will provide you with some details that should leave you with a full understanding of all the moving parts and the role those parts play.

What is WebRTC?

Wikipedia says that WebRTC (Web Real-Time Communication) is an API definition drafted by the World Wide Web Consortium (W3C) that supports browser-to-browser applications for voice calling, video chat, and P2P file sharing without the need of either internal or external plugins.

But WebRTC is not a standalone API. It needs a signaling service to coordinate communication and metadata needs to be sent between callers before a connection can be established. This metadata includes information such as:

  • Session control messages to open and close connections
  • Error messages
  • Codecs/Codec settings, bandwidth and media types
  • Keys to establish a secure connection
  • Network data such as host IP and port

What does PubNub bring to the table?

You are going to need a signal protocol service. In other words, a rock solid reliable, low latency messaging service (that would be PubNub) and a hosted WebRTC solution for the audio/video streaming (PubNub does not handle this sort of media).

PubNub IS the Signaling Protocol Service

Once signaling has taken place, video/audio/data is streamed directly between clients, using WebRTC’s PeerConnection API. This peer-to-peer direct connection allows you to stream high-bandwidth robust data, such as video. PubNub makes the signaling incredibly simple, and in addition, gives you the power to do so much more with your WebRTC applications.

What PubNub is NOT

PubNub is not a server for WebRTC. In other words, video and audio data is not streamed over the PubNub network.

  • A signaling service specifies ICE servers that the video chat can stream over.
  • Public STUN servers provided by google can be used, but they are not very reliable.
  • STUN or TURN servers are required to circumnavigate a firewall, else it will fail.
  • Many services provide the total package of signaling and server in one, that is not PubNub. Our audience are the people who want to build their own, more custom service.

More Complete Service Offerings

If you are ready to build it all using just WebRTC, a streaming service and PubNub for your signaling, then you are ready to rock with the above details. But if you want to have much of this abstracted away then keep on reading below to find out about some offerings that will get you to your end goal faster and with less effort.

Sinch - Powering Communications for Mobile Apps

Sinch is a cloud-hosted, mobile communications platform that makes adding calling, verification, video, SMS, and IM into apps easier than ever. They have an SDK that is powered by PubNub and many PubNub customers use Sinch in their applications.

Xirsys - WebRTC Cloud

XirSys hosts STUN and TURN servers catering to the needs of WebRTC applications. They created a tutorial series and demo application showing how to integrate PubNub with XirSys for a complete WebRTC solution.

Open Source Options

There are also a few open source STUN and TURN server projects that can be downloaded and hosted:

So as you can see, PubNub does not provide audio/video streaming services but if you are building this solution, PubNub is a necessary piece to tie it all together with the signal protocol.

Mobile Native Options

If you are looking to implement WebRTC features in a native Android or iOS app, check out these resources:

More WebRTC Resources and Streaming Services

If you are still hungry for more details, check out the following:





© 2016 PubNub