The RTCPeerConnection API is the heart of the peer-to-peer connection between each of the WebRTC enabled browsers or peers. To create an RTCPeerConnection object, you use the
var peerconnection = RTCPeerConnection(configuration); constructor. The
configuration variable contains at least one key named
iceServers, which is an array of URL objects that contain information about STUN, and possibly TURN servers, used during the finding candidates phase.
peerconnection object is then used in slightly different ways on each client, depending upon whether you are the caller or the callee.
Here's a summary of the caller's flow after the
peerconnection object is created: