This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
RTCPeerConnection() constructor returns a newly-created
RTCPeerConnection, which represents a connection between the local device and a remote peer.
pc = new RTCPeerConnection([configuration]);
RTCConfigurationdictionary providing options to configure the new connection.
- Specifies how to handle negotiation of candidates when the remote peer is not compatible with the SDP BUNDLE standard. This must be one of the values from the enum
RTCBundlePolicy. If this value isn't included in the dictionary,
Arrayof objects of type
RTCCertificatewhich are used by the connection for authentication. If this property isn't specified, a set of certificates is generated automatically for each
RTCPeerConnectioninstance. See Using certificates below for additional information.This configuration option cannot be changed after it is first specified; once the certificates have been set, this property is ignored in future calls to
- An unsigned 16-bit integer value which specifies the size of the prefetched ICE pool. The default value is 0 (meaning no candidate prefetching will occur). You may find in some cases that connections can be established more quickly by allowing the ICE agent to start fetching ICE candidates before you start trying to connect, so that they're already available for inspection when
- An array of
RTCIceServerobjects, each describing one server which may be used by the ICE agent; these are typically STUN and/or TURN servers.
- The current ICE transport policy; this must be one of the values from the
RTCIceTransportPolicyenum. If this isn't specified,
DOMStringwhich specifies the target peer identity for the
RTCPeerConnection. If this value is set (it defaults to
RTCPeerConnectionwill not connect to a remote peer unless it can successfully authenticate with the given name.
- The RTCP mux policy to use when gathering ICE candidates. The value must be one of those from the
RTCRtcpMuxPolicyenum. The default is
RTCPeerConnection object, configured as described by
configuration, if specified; otherwise, configured to appropriate basic defaults.
|WebRTC 1.0: Real-time Communication Between Browser
The definition of 'RTCPeerConnection()' in that specification.
|Working Draft||Initial definition.|
|Feature||Chrome||Firefox (Gecko)||Internet Explorer||Opera||Safari (WebKit)|
|Basic support||(Yes)||22 (22)||?||?||?|
|Feature||Android||Android Webview||Firefox Mobile (Gecko)||Firefox OS||IE Mobile||Opera Mobile||Safari Mobile||Chrome for Android|
|Basic support||No support||No support||24.0 (24)||?||?||?||?||(Yes)|
- Signaling and video calling
- WebRTC architecture overview
- Lifetime of a WebRTC session
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.