Getting started with WebRTC

Creating a new application based on the WebRTC technologies can be overwhelming if you're unfamiliar with the APIs. In this section we will show how to get started with the various APIs in the WebRTC standard, by explaining a number of common use cases and code snippets for solving those.


The WebRTC standard covers, on a high level, two different technologies: media capture devices and peer-to-peer connectivity.

Media capture devices includes video cameras and microphones, but also screen capturing "devices". For cameras and microphones, we use navigator.mediaDevices.getUserMedia() to capture MediaStreams. For screen recording, we use navigator.mediaDevices.getDisplayMedia() instead.

The peer-to-peer connectivity is handled by the RTCPeerConnection interface. This is the central point for establishing and controlling the connection between two peers in WebRTC.