What is WebRTC?
WebRTC stands for Web Real Time Communication. From webrtc.org:
“With WebRTC, you can add real-time communication capabilities to your application that works on top of an open standard. It supports video, voice, and generic data to be sent between peers, allowing developers to build powerful voice and video communication solutions”
The API is actually not so big and complicated as it sounds. The MDN website is, as always, very complete https://developer.mozilla.org/en-US/docs/Glossary/WebRTC.
We have 3 main parts:
In webrtc.org we can find many useful samples https://webrtc.github.io/samples/
Let’s dissect a basic peer-to-peer connection.
First, we will need two video elements, one to see the other person and another one to see ourselves:
<video id="localVideo" playsinline autoplay muted></video>
<video id="remoteVideo" playsinline autoplay></video>
#webrtc #html5 #javascript #communication #video-streaming #streaming #realtime #api