WebRTC and Websockets. Is there any difference

I assume that WebRTC is an API that decodes / encodes audio and video, although the communication between the server and clients is via web sockets or some other network protocol? I am a bit confused. Does WebRTC have its own communication protocol?

+47
javascript html5 websocket webrtc
Oct 05 '12 at 3:45
source share
4 answers

There are two sides to WebRTC.

  • JavaScript APIs ( getUserMedia ) that allow an application to access camera and microphone devices. You can use this access to simply display the stream locally ( effects can be applied ) or send the stream over the network. You can send data to your server or use ...
  • PeerConnection , an API that allows browsers to establish direct peer-to-peer socket connections. You can directly connect to another browser and exchange data directly. This is very useful for high-bandwidth data such as video, where you do not want your server to deal with relaying large amounts of data.

Check out the demo to see both parts of WebRTC in action.

So, in a nutshell:

  • WebSockets provides full duplex communication between the browser and the web server.
  • WebRTC PeerConnection provides full duplex communication between two browsers.
+81
05 Oct
source share

WebRTC uses RTP (UDP-based protocol) for multimedia transport, but an out-of-band signaling channel is required to establish communications. One option for a signaling channel is WebSocket.

+12
Oct 05 '12 at 8:01
source share

Instead of peerConnection you can also view the draft WebRTC data feed: http://tools.ietf.org/html/draft-jesup-rtcweb-data-protocol-00 , which is basically a bidirectional udp. This can be a really valuable alternative to WebSockets, as it does not have the β€œnegative” sides of a tcp connection.

+3
Oct 05
source share

No, the alarm is not detected by WebRTC.

Here is a post from the IETF that explains this pretty well, why it isn't: http://www.ietf.org/mail-archive/web/rtcweb/current/msg01143.html

This means that you can freely choose how you exchange network information. That is, you could use websockets, HTTP, and even email, but that would be a bit crowded :)

+2
Aug 19 '13 at 7:43 on
source share



All Articles