I'm assuming that WebRTC is an API that decodes/encodes audio and video, although the communication between the server and the clients is done via web sockets, or some other network protocol? I'm a bit confused. Does WebRTC have its own communications protocol?
What is the difference between WebRTC and WebSockets? While both are part of the HTML5 specification, WebSockets are meant to enable bidirectional communication between a browser and a web server and WebRTC is meant to offer real time communication between browsers (predominantly voice and video communications).
WebRTC vs WebSockets – Key DifferencesWebRTC is more secure; At the moment, WebRTC is only supported by certain browsers while WebSockets is compatible with almost all existing browsers; In terms of scalability, WebSockets uses a server per session approach and WebRTC is peer-to-peer.
Websockets are highly faster than WebRTC !
WebSocket approach is ideal for real-time scalable application, whereas REST is better suited for the scenario with lots of getting request. WebSocket is a stateful protocol, whereas REST is based on stateless protocol, i.e. the client does not need to know about the server and the same hold true for the server.
There's two sides to WebRTC.
getUserMedia
) that allow an app to access camera and microphone hardware. You can use this access to simply display the stream locally (perhaps applying effects), or send the stream over the network. You could send the data to your server, or you could use...PeerConnection
, an API that allows browsers to establish direct peer-to-peer socket connections. You can establish a connection directly to someone else's browser and exchange data directly. This is very useful for high-bandwidth data like video, where you don't want your server to have to deal with relaying large amounts of data.Take a look at the demos to see both parts of WebRTC in action.
So in a nutshell:
PeerConnection
allows full-duplex communication between two browsers.WebRTC uses RTP (a UDP based protocol) for the media transport, but requires an out-of-band signaling channel to setup the communication. One option for the signaling channel is WebSocket.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With