WebRTC API

Summary

The MediaStream interface of the WebRTC API describes a stream of audio or video data. A MediaStream object represents a linear, potentially infinite timeline. It is not preloadable, nor is it seekable.

Usage

The RTC in WebRTC stands for Real-Time Communications, technology that enables audio/video streaming and data sharing between browser clients (peers). As a set of standards, WebRTC provides any browser with the ability to share application data and perform teleconferencing peer to peer, without the need to install plug-ins or third-party software.

WebRTC components are accessed with JavaScript APIs. Currently in development are the Network Stream API, which represents an audio or video data stream, and the PeerConnection API, which allows two or more users to communicate browser-to-browser. Also under development is a DataChannel API that enables communication of other types of data for real-time gaming, text chat, file transfer, and so forth.

MediaStream objects have an input and an output. A LocalMediaStream is a MediaStream object generated by getUserMedia(), and which has as its source input the user’s camera or microphone. The output describes how the consumer uses the MediaStream object. The consumer is either of the media elements, <audio> or <video>, or the PeerConnection API.

PeerConnection API

The PeerConnection API, represented chiefly by the RTCPeerConnection object, provides for the exchange of MediaStream object data between browser instances (peers) across a secure channel. The process starts with signaling from one peer to others through a server. The signaling protocol is determined by the application, and once established, encapsulated in the RTCSessionDescription object.

DataChannel API

TODO: Add more information here.

The DataChannel API, represented by the RTCDataChannel and leveraged through RTCPeerConnection, provides for the exchange of strings or binary data between peers. A data channel can be reliable, semi reliable and not reliable.