WebRTC (Web Real-Time Communications) is a technology which enables Web applications and sites to capture and optionally stream audio and/or video media, as well as to exchange arbitrary data between browsers without requiring an intermediary. The set of standards that comprises WebRTC makes it possible to share data and perform teleconferencing peer-to-peer, without requiring that the user install plug-ins or any other third-party software.
WebRTC consists of several interrelated APIs and protocols which work together to achieve this. The documentation you'll find here will help you understand the fundamentals of WebRTC, how to set up and use both data and media connections, and more.
WebRTC concepts and usage
WebRTC serves multiple purposes, and overlaps substantially with the Media Capture and Streams API. Together, they provide powerful multimedia capabilities to the Web, including support for audio and video conferencing, file exchange, identity management, and interfacing with legacy telephone systems by sending DTMF signals. Connections between peers can be made without requiring any special drivers or plug-ins, and can often be made without any intermediary servers.
Connections between two peers are created using—and represented by—the
RTCPeerConnection interface. Once a connection has been established and opened, media streams (
MediaStreams) and/or data channels (
RTCDataChannels) can be added to the connection.
Media streams can consist of any number of tracks of media information; tracks, which are represented by objects based on the
MediaStreamTrack interface, may contain one of a number of types of media data, including audio, video, and text (such as subtitles or even chapter names). Most streams consist of at least one audio track and likely also a video track, and can be used to send and receive both live media or stored media information (such as a streamed movie).
You can also use the connection between two peers to exchange arbitrary binary data using the
RTCDataChannel interface. This can be used for back-channel information, metadata exchange, game status packets, file transfers, or even as a primary channel for data transfer.
more details and links to relevant guides and tutorials needed
Because WebRTC provides interfaces that work together to accomplish a variety of tasks, we have divided up the interfaces in the list below by category. Please see the sidebar for an alphabetical list.
Connection setup and management
These interfaces are used to set up, open, and manage WebRTC connections.
- Represents a WebRTC connection between the local computer and a remote peer. It is used to handle efficient streaming of data between the two peers.
- Represents a bi-directional data channel between two peers of a connection.
- Represents events that occur while attaching a
RTCPeerConnection. The only event sent with this interface is
- Represents the parameters of a session. Each
RTCSessionDescriptionconsists of a description
typeindicating which part of the offer/answer negotiation process it describes and of the SDP descriptor of the session.
- The RTCSessionDescriptionCallback is passed into the
RTCPeerConnectionobject when requesting it to create offers or answers.
- Provides information detailing statistics for a connection or for an individual track on the connection; the report can be obtained by calling
- Represents a candidate internet connectivity establishment (ICE) server for establishing an
- Represents information about an internet connectivity establishment (ICE) transport.
- Defines how to connect to a single ICE server (such as a STUN or TURN server).
- Represents events that occurs in relation to ICE candidates with the target, usually an
RTCPeerConnection. Only one event is of this type:
- Manages the encoding and transmission of data for a
- Manages the reception and decoding of data for a
- Contains information about a given contributing source (CSRC) including the most recent time a packet that the source contributed was played out.
- Indicates that a new incoming
MediaStreamTrackwas created and an associated
RTCRtpReceiverobject was added to the
- Used to provide configuration options for an
- Provides information which describes a Stream Control Transmission Protocol (SCTP) transport and also provides a way to access the underlying Datagram Transport Layer Security (DTLS) transport over which SCTP packets for all of an
RTCPeerConnection's data channels are sent and received.
Identity and security
The WebRTC API includes a number of interfaces to manage security and identity.
- Enables a user agent is able to request that an identity assertion be generated or validated.
- Represents the identity of the a remote peer of the current connection. If no peer has yet been set and verified this interface returns
null. Once set it can't be changed.
- Registers an identity provider (idP).
- Represents an identity assertion generated by an identity provider (idP). This is usually for an
RTCPeerConnection. The only event sent with this type is
- Represents an error associated with the identity provider (idP). This is usually for an
RTCPeerConnection. Two events are sent with this type:
- Represents a certificate that an
RTCPeerConnectionuses to authenticate.
These interfaces are related to interactivity with public-switched telephone networks (PTSNs).
- Manages the encoding and transmission of dual-tone multi-frequency (DTMF) signaling for an
- Indicates an occurrence of a of dual-tone multi-frequency (DTMF). This event does not bubble (except where otherwise stated) and is not cancelable (except where otherwise stated).
- Introduction to WebRTC protocols
- This article introduces the protocols on top of which the WebRTC API is built.
- WebRTC connectivity
- A guide to how WebRTC connections work and how the various protocols and interfaces can be used together to build powerful communication apps.
- Lifetime of a WebRTC session
- WebRTC lets you build peer-to-peer communication of arbitrary data, audio, or video—or any combination thereof—into a browser application. In this article, we'll look at the lifetime of a WebRTC session, from establishing the connection all the way through closing the connection when it's no longer needed.
- Signaling and two-way video calling
- A tutorial and example which turns a WebSocket-based chat system created for a previous example and adds support for opening video calls among participants. The chat server's WebSocket connection is used for WebRTC signaling.
- Using WebRTC data channels
- This guide covers how you can use a peer connection and an associated
RTCDataChannelto exchange arbitrary data between two peers.
- Using DTMF with WebRTC
- WebRTC's support for interacting with gateways that link to old-school telephone systems includes support for sending DTMF tones using the
RTCDTMFSenderinterface. This guide shows how to do so.
- Improving compatibility using WebRTC adapter.js
- Taking still photos with WebRTC
- This article shows how to use WebRTC to access the camera on a computer or mobile phone with WebRTC support and take a photo with it.
- A simple RTCDataChannel sample
RTCDataChannelinterface is a feature which lets you open a channel between two peers over which you may send and receive arbitrary data. The API is intentionally similar to the WebSocket API, so that the same programming model can be used for each.
- Application Layer Protocol Negotiation for Web Real-Time Communications
- WebRTC Audio Codec and Processing Requirements
- RTCWeb Data Channels
- RTCWeb Data Channel Protocol
- Web Real-Time Communication (WebRTC): Media Transport and Use of RTP
- WebRTC Security Architecture
- Transports for RTCWEB
Related supporting protocols
- Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal for Offer/Answer Protocol
- Session Traversal Utilities for NAT (STUN)
- URI Scheme for the Session Traversal Utilities for NAT (STUN) Protocol
- Traversal Using Relays around NAT (TURN) Uniform Resource Identifiers
- An Offer/Answer Model with Session Description Protocol (SDP)
- Session Traversal Utilities for NAT (STUN) Extension for Third Party Authorization
|WebRTC 1.0: Real-time Communication Between Browsers||Candidate Recommendation||The initial definition of the API of WebRTC.|
|Media Capture and Streams||Candidate Recommendation||The initial definition of the object conveying the stream of media content.|
|Media Capture from DOM Elements||Working Draft||The initial definition on how to obtain stream of content from DOM Elements|
In additions to these specifications defining the API needed to use WebRTC, there are several protocols, listed under resources.