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.
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:
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).
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.
PubNub is not a server for WebRTC. In other words, video and audio data is not streamed over the PubNub network.
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 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 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.
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.
If you are looking to implement WebRTC features in a native Android or iOS app, check out these resources:
If you are still hungry for more details, check out the following: