If you wanted to build something that allowed for voice or video calling a few years ago, you would have used C/C++. This would involve long development cycles and high development costs. WebRTC changes all that - it replaces C/C++ with a Javascript API.
There are 3 primary components of the WebRTC API:
- Media Stream: It acquires audio and video by accessing your device camera and microphone.
- Peer Connection: It communicates audio and video. Allows peer-to-peer audio and video communication. This includes establishing the initial connection, monitoring and closing the connection.
- Data Channel: It communicates arbitrary data. Enables bidirectional transfers of data between two peers.
These APIs allow browsers to use and send audio, video, and data to other browsers or endpoints.