WebRTC
The RTCCertificate interface of the WebRTC API provides an object representing a certificate that an RTCPeerConnection uses to authenticate.
RTCCertificate is a serializable object, so it can be cloned with structuredClone() or copied between Workers using postMessage().
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 49 | 79 | 42 | 12.1 | 49 | 12.2 | |
| The read-only expires property of the RTCCertificate interface returns the expiration date of the certificate. | 49 | 79 | 42 | 12.1 | 49 | 12.2 |
| The getFingerprints() method of the RTCCertificate interface is used to get an array of certificate fingerprints. | 61 | 79 | 138 | 12.1 | 61 | 12.2 |
| The RTCDataChannel interface represents a network channel which can be used for bidirectional peer-to-peer transfers of arbitrary data. Every data channel is associated with an RTCPeerConnection, and each peer connection can have up to a theoretical maximum of 65,534 data channels (the actual limit may vary from browser to browser). | 24 | 79 | 22 | 11 | 25 | 11 |
| The property binaryType on the RTCDataChannel interface is a string which specifies the type of object which should be used to represent binary data received on the RTCDataChannel. Values allowed by the WebSocket.binaryType property are also permitted here: blob if Blob objects are being used or arraybuffer if ArrayBuffer objects are being used. The default… | 24 | 79 | 22 | 11 | 25 | 11 |
binaryType (arraybuffer value) `ArrayBuffer` value | 24 | 79 | 22 | 11 | 25 | 11 |
binaryType (blob value) `Blob` value | 129 | 129 | 22 | 11 | 129 | 11 |
| The read-only RTCDataChannel property bufferedAmount returns the number of bytes of data currently queued to be sent over the data channel. The queue may build up as a result of calls to the RTCDataChannel.send method. This only includes data buffered by the user agent itself; it doesn't include any framing overhead or buffering done by the operating system… | 24 | 79 | 22 | 11 | 25 | 11 |
| A bufferedamountlow event is sent to an RTCDataChannel when the number of bytes currently in the outbound data transfer buffer (RTCDataChannel.bufferedAmount) falls from above to below or equal the threshold specified in RTCDataChannel.bufferedAmountLowThreshold. | 57 | 79 | 44 | 11 | 57 | 11 |
| The RTCDataChannel property bufferedAmountLowThreshold is used to specify the number of bytes of buffered outgoing data that is considered "low." The default value is 0\. When the number of buffered outgoing bytes, as indicated by the RTCDataChannel.bufferedAmount property, falls to or below this value, a RTCDataChannel.bufferedamountlowevent event is… | 46 | 79 | 44 | 11 | 46 | 11 |
| The RTCDataChannel.close() method closes the RTCDataChannel. Either peer is permitted to call this method to initiate closure of the channel. | 24 | 79 | 22 | 11 | 25 | 11 |
| The close event is sent to the onclose event handler on an RTCDataChannel instance when the data transport for the data channel has closed. Before any further data can be transferred using RTCDataChannel, a new 'RTCDataChannel' instance must be created. | 24 | 79 | 22 | 11 | 25 | 11 |
| The closing event is sent to an RTCDataChannel just before the channel begins the process of shutting down its underlying data transport. | 81 | 81 | 144 | 15.4 | 81 | 15.4 |
| A WebRTC error event is sent to an RTCDataChannel object's onerror event handler when an error occurs on the data channel. | 24 | 79 | 22 | 11 | 25 | 11 |
| The read-only RTCDataChannel property id returns an ID number (between 0 and 65,534) which uniquely identifies the RTCDataChannel. This ID is set at the time the data channel is created, either by the user agent (if RTCDataChannel.negotiated is false) or by the site or app script (if negotiated is true). | 30 | 79 | 22 | 11 | 30 | 11 |
| The read-only RTCDataChannel property label returns a string containing a name describing the data channel. These labels are not required to be unique. | 24 | 79 | 22 | 11 | 25 | 11 |
| The read-only RTCDataChannel property maxPacketLifeTime returns the amount of time, in milliseconds, the browser is allowed to take to attempt to transmit a message, as set when the data channel was created, or null. This limits how long the browser can continue to attempt to transmit and retransmit the message before giving up. | 56 | 79 | 62 | 11 | 56 | 11 |
| The read-only RTCDataChannel property maxRetransmits returns the maximum number of times the browser should try to retransmit a message before giving up, as set when the data channel was created, or null, which indicates that there is no maximum. This can only be set when the RTCDataChannel is created by calling RTCPeerConnection.createDataChannel(), using… | 30 | 79 | 62 | 11 | 30 | 11 |
| The WebRTC message event is sent to the onmessage event handler on an RTCDataChannel object when a message has been received from the remote peer. | 24 | 79 | 22 | 11 | 25 | 11 |
| The read-only RTCDataChannel property negotiated indicates whether the RTCDataChannel's connection was negotiated by the Web app (true) or by the WebRTC layer (false). The default is false. | 30 | 79 | 68 | 11 | 30 | 11 |
| The WebRTC open event is sent to an RTCDataChannel object's onopen event handler when the underlying transport used to send and receive the data channel's messages is opened or reopened. | 24 | 79 | 22 | 11 | 25 | 11 |
| The read-only RTCDataChannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered. This is set when the RTCDataChannel is created, by setting the ordered property on the object passed as RTCPeerConnection.createDataChannel()'s options… | 30 | 79 | 22 | 11 | 30 | 11 |
| The read-only RTCDataChannel property protocol returns a string containing the name of the subprotocol in use. If no protocol was specified when the data channel was created, then this property's value is the empty string (""). | 30 | 79 | 22 | 11 | 30 | 11 |
| The read-only RTCDataChannel property readyState returns a string which indicates the state of the data channel's underlying data connection. | 24 | 79 | 22 | 11 | 25 | 11 |
sctp_sdp_21 Support for sctp-sdp-21 format | 58 | 79 | 63 | | 58 | |
| The send() method of the RTCDataChannel interface sends data across the data channel to the remote peer. This can be done any time except during the initial process of creating the underlying transport channel. Data sent before connecting is buffered if possible (or an error occurs if it's not possible), and is also buffered if sent while the connection is… | 24 | 79 | 22 | 11 | 25 | 11 |
| Transferable objects are objects that own resources that can be transferred from one context to another, ensuring that the resources are only available in one context at a time. Following a transfer, the original object is no longer usable; it no longer points to the transferred resource, and any attempt to read or write the object will throw an exception. | 130 | 130 | 144 | 15 | 130 | 15 |
| The RTCDataChannelEvent interface represents an event related to a specific RTCDataChannel. | 24 | 79 | 22 | 11 | 25 | 11 |
| The read-only property RTCDataChannelEvent.channel returns the RTCDataChannel associated with the event. | 24 | 79 | 22 | 11 | 25 | 11 |
| The RTCDataChannelEvent() constructor creates a new RTCDataChannelEvent object. | 56 | 79 | 22 | 11 | 56 | 11 |
| The RTCDtlsTransport interface provides access to information about the Datagram Transport Layer Security (DTLS) transport over which a RTCPeerConnection's RTP and RTCP packets are sent and received by its RTCRtpSender and RTCRtpReceiver objects. | 72 | 12 | 82 | 15.4 | 72 | 15.4 |
| An RTCDtlsTransport receives an error event when a transport-level error occurs on the RTCPeerConnection. | 72 | 12 | | 15.4 | 72 | 15.4 |
getRemoteCertificates | 72 | 12 | | 15.4 | 72 | 15.4 |
| The iceTransport read-only property of the RTCDtlsTransport interface contains a reference to the underlying RTCIceTransport. | 72 | 79 | 125 | 15.4 | 72 | 15.4 |
| The state read-only property of the RTCDtlsTransport interface provides information which describes a Datagram Transport Layer Security (DTLS) transport state. | 72 | 12 | 82 | 15.4 | 72 | 15.4 |
| A statechange event occurs when the RTCDtlsTransport changes state. The RTCDtlsTransport.state property can be used to determine the current state of the underlying Datagram Transport Layer Security (DTLS) transport. | 72 | 79 | 82 | 15.4 | 72 | 15.4 |
| The RTCDTMFSender interface provides a mechanism for transmitting DTMF codes on a WebRTC RTCPeerConnection. You gain access to the connection's RTCDTMFSender through the RTCRtpSender.dtmf property on the audio track you wish to send DTMF with. | 27 | 79 | 52 | 13.1 | 27 | 13.4 |
| The canInsertDTMF read-only property of the RTCDTMFSender interface returns a boolean value which indicates whether the RTCDTMFSender is capable of sending DTMF tones over the RTCPeerConnection. | 27 | 79 | 129 | 13.1 | 27 | 13.4 |
| The insertDTMF() method of the RTCDTMFSender interface sends DTMF tones to the remote peer over the RTCPeerConnection. | 27 | 79 | 52 | 13.1 | 27 | 13.4 |
| The RTCDTMFSender interface's toneBuffer property returns a string containing a list of the DTMF tones currently queued for sending to the remote peer over the RTCPeerConnection. To place tones into the buffer, call RTCDTMFSender.insertDTMF. | 27 | 79 | 52 | 13.1 | 27 | 13.4 |
| The tonechange event is sent to an RTCDTMFSender by the WebRTC API to indicate when DTMF tones previously queued for sending (by calling RTCDTMFSender.insertDTMF()) begin and end. | 27 | 79 | 52 | 13.1 | 27 | 13.4 |
| The RTCDTMFToneChangeEvent interface represents events sent to indicate that DTMF tones have started or finished playing. This interface is used by the tonechange event. | 27 | 12 | 52 | 13.1 | 27 | 13.4 |
| The RTCDTMFToneChangeEvent() constructor creates a new RTCDTMFToneChangeEvent object. | 27 | 13 | 52 | 13.1 | 27 | 13.4 |
| The read-only property RTCDTMFToneChangeEvent.tone returns the DTMF character which has just begun to play, or an empty string (""). if all queued tones have finished playing (that is, RTCDTMFSender.toneBuffer is empty). | 27 | 12 | 52 | 13.1 | 27 | 13.4 |
| The RTCError interface of the WebRTC API describes an error which has occurred while handling RTC operations. It's based upon the standard DOMException interface that describes general DOM errors. | 74 | 79 | 150 | 15.4 | 74 | 15.4 |
| The errorDetail read-only property of the RTCError interface is a string indicating the WebRTC-specific error code that occurred. | 74 | 79 | 150 | 15.4 | 74 | 15.4 |
| The receivedAlert read-only property of the RTCError interface specifies the fatal DTLS error which resulted in an alert being received from the remote peer. | 74 | 79 | 150 | 15.4 | 74 | 15.4 |
RTCError `RTCError()` constructor | 74 | 79 | 150 | 15.4 | 74 | 15.4 |
| The sctpCauseCode read-only property of the RTCError interface provides the SCTP cause code explaining why the SCTP negotiation failed, if the RTCError represents an SCTP error. | 74 | 79 | 150 | 15.4 | 74 | 15.4 |
| The sdpLineNumber read-only property of the RTCError interface specifies the SDP message line number where a syntax error occurred. | 74 | 79 | 150 | 15.4 | 74 | 15.4 |
| The sentAlert read-only property of the RTCError interface specifies the DTLS alert number sent to the remote peer, if the error represents an outbound DTLS error. | 74 | 79 | 150 | 15.4 | 74 | 15.4 |
| The RTCErrorEvent interface of the WebRTC API represents an error event sent to a WebRTC object. It inherits from the standard Event interface, adding RTC-specific information describing the error. | 74 | 79 | 150 | 15.4 | 74 | 15.4 |
| The error read-only property of the RTCErrorEvent interface contains an RTCError object that describes the WebRTC-specific details of the error. | 74 | 79 | 150 | 15.4 | 74 | 15.4 |
RTCErrorEvent `RTCErrorEvent()` constructor | 74 | 79 | 150 | 15.4 | 74 | 15.4 |
| The RTCIceCandidate interface—part of the WebRTC API—represents a candidate Interactive Connectivity Establishment (ICE) configuration which may be used to establish an RTCPeerConnection. | 23 | 15 | 44 | 11 | 25 | 11 |
| The RTCIceCandidate interface's read-only address property is a string providing the IP address of the device which is the source of the candidate. The address is null by default if not otherwise specified. | 74 | 79 | 126 | 14.1 | 74 | 14.5 |
| The read-only property candidate on the RTCIceCandidate interface returns a string describing the candidate in detail. Most of the other properties of RTCIceCandidate are actually extracted from this string. | 23 | 15 | 22 | 11 | 25 | 11 |
| The read-only component property on the RTCIceCandidate interface is a string which indicates whether the candidate is an RTP or an RTCP candidate. | 74 | 79 | 126 | 14.1 | 74 | 14.5 |
| The foundation read-only property of the RTCIceCandidate interface is a string that allows correlation of candidates from a common network path on multiple RTCIceTransport objects. | 74 | 79 | 126 | 14.1 | 74 | 14.5 |
| The RTCIceCandidate interface's read-only port property contains the port number on the device at the address given by RTCIceCandidate.address at which the candidate's peer can be reached. | 74 | 79 | 126 | 14.1 | 74 | 14.5 |
| The RTCIceCandidate interface's read-only priority property specifies the candidate's priority according to the remote peer; the higher this value is, the better the remote peer considers the candidate to be. | 74 | 79 | 126 | 14.1 | 74 | 14.5 |
| The RTCIceCandidate interface's read-only protocol property is a string which indicates whether the candidate uses UDP or TCP as its transport protocol. | 74 | 79 | 126 | 14.1 | 74 | 14.5 |
| The RTCIceCandidate interface's read-only relatedAddress property is a string indicating the related address of a relay or reflexive candidate. | 74 | 79 | 126 | 14.1 | 74 | 14.5 |
| The RTCIceCandidate interface's read-only relatedPort property indicates the port number of reflexive or relay candidates. | 74 | 79 | 126 | 14.1 | 74 | 14.5 |
relayProtocol Experimental | 124 | 124 | | | 124 | |
| The RTCIceCandidate() constructor creates and returns a new RTCIceCandidate object, which can be configured to represent a single ICE candidate. | 23 | 15 | 44 | 11 | 25 | 11 |
| The read-only property sdpMid on the RTCIceCandidate interface returns a string specifying the media stream identification tag of the media component with which the candidate is associated. This ID uniquely identifies a given stream for the component with which the candidate is associated. | 23 | 15 | 22 | 11 | 25 | 11 |
| The read-only sdpMLineIndex property on the RTCIceCandidate interface is a zero-based index of the m-line describing the media associated with the candidate. | 23 | 15 | 22 | 11 | 25 | 11 |
| The RTCIceCandidate interface's read-only tcpType property is included on TCP candidates to provide additional details about the candidate type. | 74 | 79 | 126 | 14.1 | 74 | 14.5 |
| The RTCIceCandidate method toJSON() converts the RTCIceCandidate on which it's called into JSON. | 43 | 15 | 27 | 11 | 43 | 11 |
| The RTCIceCandidate interface's read-only type specifies the type of candidate the object represents. | 74 | 79 | 126 | 14.1 | 74 | 14.5 |
url Experimental | 124 | 124 | | | 124 | |
| The read-only usernameFragment property on the RTCIceCandidate interface is a string indicating the username fragment ("ufrag") that uniquely identifies a single ICE interaction session. | 74 | 79 | 67 | 14.1 | 74 | 14.5 |
| The RTCIceTransport interface provides access to information about the ICE transport layer over which the data is being sent and received. This is particularly useful if you need to access state information about the connection. | 75 | 13 | 125 | 11 | 75 | 11 |
| The gatheringState read-only property of the RTCIceTransport interface returns a string that indicates the current gathering state of the ICE agent for this transport: "new", "gathering", or "complete". | 75 | 79 | 125 | 11 | 75 | 11 |
| A gatheringstatechange event is sent to an RTCIceTransport when its ICE candidate gathering state changes. | 75 | 79 | 125 | 15.4 | 75 | 15.4 |
| The getLocalCandidates() method of the RTCIceTransport interface returns an array of RTCIceCandidate objects, one for each of the candidates that have been gathered by the local device during the current ICE agent session. | 75 | 79 | | | 75 | |
| The getLocalParameters() method of the RTCIceTransport interface returns an RTCIceParameters object that provides information uniquely identifying the local peer for the duration of the ICE session. | 75 | 79 | | | 75 | |
| The getRemoteCandidates() method of the RTCIceTransport interface returns an array that contains one RTCIceCandidate for each of the candidates that have been received from the remote peer so far during the current ICE gathering session. | 75 | 13 | | | 75 | |
| The getRemoteParameters() method of the RTCIceTransport interface returns an RTCIceParameters object that provides information uniquely identifying the remote peer for the duration of the ICE session. | 75 | 13 | | | 75 | |
| The getSelectedCandidatePair() method of the RTCIceTransport interface returns an RTCIceCandidatePair object containing the current best-choice pair of ICE candidates describing the configuration of the endpoints of the transport. | 75 | 79 | | 16.4 | 75 | 16.4 |
| The role read-only property of the RTCIceTransport interface indicates which ICE role the transport is fulfilling: that of the controlling agent, or the agent that is being controlled. | 75 | 13 | 150 | | 75 | |
| A selectedcandidatepairchange event is sent to an RTCIceTransport when the ICE agent selects a new pair of candidates that describe the endpoints of a viable connection. | 75 | 79 | | 16.4 | 75 | 16.4 |
| The state read-only property of the RTCIceTransport interface returns the current state of the ICE transport, so you can determine the state of ICE gathering in which the ICE agent currently is operating. | 75 | 13 | 125 | 11 | 75 | 11 |
| A statechange event occurs when the RTCIceTransport changes state. The RTCIceTransport.state can be used to determine how far through the process of examining, verifying, and selecting a valid candidate pair is prior to successfully connecting the two peers for WebRTC communications. | 75 | 79 | 125 | 15.4 | 75 | 15.4 |
| The RTCPeerConnection interface represents a WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed. | 56 | 15 | 44 | 11 | 56 | 11 |
| The addIceCandidate() method of the RTCPeerConnection interface adds a new remote candidate to the connection's remote description, which describes the state of the remote end of the connection. | 24 | 15 | 22 | 11 | 25 | 11 |
addIceCandidate (returns promise) Returns a `Promise` | 50 | 79 | 37 | 11 | 50 | 11 |
| The addTrack() method of the RTCPeerConnection interface adds a new media track to the set of tracks which will be transmitted to the other peer. | 64 | 79 | 22 | 11 | 64 | 11 |
| The addTransceiver() method of the RTCPeerConnection interface creates a new RTCRtpTransceiver and adds it to the set of transceivers associated with the RTCPeerConnection. Each transceiver represents a bidirectional stream, with both an RTCRtpSender and an RTCRtpReceiver associated with it. | 69 | 79 | 59 | 11 | 69 | 11 |
addTransceiver (init direction parameter) `init.direction` parameter | 69 | 79 | 59 | 11 | 69 | 11 |
addTransceiver (init sendEncodings parameter) `init.sendEncodings` parameter | 69 | 79 | 110 | 14.1 | 69 | 14.5 |
addTransceiver (init streams parameter) `init.streams` parameter | 69 | 79 | 59 | 12.1 | 69 | 12.2 |
| The canTrickleIceCandidates read-only property of the RTCPeerConnection interface returns a boolean value which indicates whether or not the remote peer can accept trickled ICE candidates. | 83 | 83 | 47 | 15.4 | 83 | 15.4 |
| The close() method of the RTCPeerConnection interface closes the current peer connection. | 23 | 15 | 22 | 11 | 25 | 11 |
| The connectionState read-only property of the RTCPeerConnection interface indicates the current state of the peer connection by returning one of the following string values: new, connecting, connected, disconnected, failed, or closed. | 72 | 79 | 113 | 11 | 72 | 11 |
| The connectionstatechange event is sent to the onconnectionstatechange event handler on an RTCPeerConnection object after a new track has been added to an RTCRtpReceiver which is part of the connection. The new connection state can be found in RTCPeerConnection.connectionState, and is one of the string values: new, connecting, connected, disconnected,… | 72 | 79 | 113 | 11 | 72 | 11 |
| The createAnswer() method of the RTCPeerConnection interface creates an SDP answer to an offer received from a remote peer during the offer/answer negotiation of a WebRTC connection. | 24 | 15 | 22 | 11 | 25 | 11 |
createAnswer (returns promise) Returns a `Promise` | 51 | 79 | 37 | 11 | 51 | 11 |
| The createDataChannel() method of the RTCPeerConnection interface creates a new channel linked with the remote peer, over which any kind of data may be transmitted. This can be useful for back-channel content, such as images, file transfer, text chat, game update packets, and so forth. | 24 | 79 | 22 | 11 | 25 | 11 |
| The createOffer() method of the RTCPeerConnection interface initiates the creation of an SDP offer for the purpose of starting a new WebRTC connection to a remote peer. | 24 | 15 | 22 | 11 | 25 | 11 |
createOffer (returns promise) Returns a `Promise` | 51 | 79 | 37 | 11 | 51 | 11 |
| The currentLocalDescription read-only property of the RTCPeerConnection interface returns an RTCSessionDescription object describing the local end of the connection as it was most recently successfully negotiated since the last time the RTCPeerConnection finished negotiating and connecting to a remote peer. Also included is a list of any ICE candidates that… | 70 | 79 | 22 | 11 | 70 | 11 |
| The currentRemoteDescription read-only property of the RTCPeerConnection interface returns an RTCSessionDescription object describing the remote end of the connection as it was most recently successfully negotiated since the last time the RTCPeerConnection finished negotiating and connecting to a remote peer. Also included is a list of any ICE candidates… | 70 | 79 | 57 | 11 | 70 | 11 |
| A datachannel event is sent to an RTCPeerConnection instance when an RTCDataChannel has been added to the connection, as a result of the remote peer calling RTCPeerConnection.createDataChannel(). | 25 | 79 | 22 | 11 | 25 | 11 |
| The generateCertificate() static function of the RTCPeerConnection interface creates an X.509 certificate and corresponding private key, returning a promise that resolves with the new RTCCertificate once it's generated. | 48 | 79 | 22 | 12.1 | 48 | 12.2 |
| The getConfiguration() method of the RTCPeerConnection interface returns an object which indicates the current configuration of the RTCPeerConnection on which the method is called. | 70 | 15 | 22 | 11 | 70 | 11 |
| The getReceivers() method of the RTCPeerConnection interface returns an array of RTCRtpReceiver objects, each of which represents one RTP receiver. Each RTP receiver manages the reception and decoding of data for a MediaStreamTrack on an RTCPeerConnection. | 59 | 79 | 34 | 11 | 59 | 11 |
getReceivers (stopped transceivers removed) Receivers for stopped transceivers not returned | 88 | 88 | 118 | | 88 | |
| The getSenders() method of the RTCPeerConnection interface returns an array of RTCRtpSender objects, each of which represents the RTP sender responsible for transmitting one track's data. A sender object provides methods and properties for examining and controlling the encoding and transmission of the track's data. | 64 | 79 | 34 | 11 | 64 | 11 |
getSenders (stopped transceivers removed) Senders for stopped transceivers not returned | 88 | 88 | 118 | | 88 | |
| The getTransceivers() method of the RTCPeerConnection interface returns a list of the RTCRtpTransceiver objects being used to send and receive data on the connection. | 69 | 79 | 59 | 11 | 69 | 11 |
getTransceivers (stopped transceivers removed) Stopped transcievers not returned | 88 | 88 | 118 | | 88 | |
| An icecandidate event is sent to an RTCPeerConnection when: | 24 | 15 | 22 | 11 | 25 | 11 |
| The icecandidateerror event is sent to an RTCPeerConnection if an error occurs while performing ICE negotiation through a STUN or TURN server. | 77 | 79 | 150 | 14.1 | 77 | 14.5 |
| The iceConnectionState read-only property of the RTCPeerConnection interface returns a string which state of the ICE agent associated with the RTCPeerConnection: new, checking, connected, completed, failed, disconnected, and closed. | 26 | 15 | 24 | 11 | 26 | 11 |
| An iceconnectionstatechange event is sent to an RTCPeerConnection object each time the ICE connection state changes during the negotiation process. The new ICE connection state is available in the object's RTCPeerConnection.iceConnectionState property. | 28 | 15 | 24 | 11 | 28 | 11 |
| The iceGatheringState read-only property of the RTCPeerConnection interface returns a string that describes the overall ICE gathering state for this connection. This lets you detect, for example, when collection of ICE candidates has finished. | 25 | 15 | 22 | 11 | 25 | 11 |
| The icegatheringstatechange event is sent to the onicegatheringstatechange event handler on an RTCPeerConnection when the state of the ICE candidate gathering process changes. This signifies that the value of the connection's RTCPeerConnection.iceGatheringState property has changed. | 59 | 15 | 22 | 11 | 59 | 11 |
| The localDescription read-only property of the RTCPeerConnection interface returns an RTCSessionDescription describing the session for the local end of the connection. If it has not yet been set, this is null. | 24 | 15 | 22 | 11 | 25 | 11 |
| A negotiationneeded event is sent to the RTCPeerConnection when negotiation of the connection through the signaling channel is required. This occurs both during the initial setup of the connection as well as any time a change to the communication environment requires reconfiguring the connection. | 24 | 15 | 38 | 11 | 25 | 11 |
| The pendingLocalDescription read-only property of the RTCPeerConnection interface returns an RTCSessionDescription object describing a pending configuration change for the local end of the connection. | 70 | 79 | 22 | 11 | 70 | 11 |
| The pendingRemoteDescription read-only property of the RTCPeerConnection interface returns an RTCSessionDescription object describing a pending configuration change for the remote end of the connection. | 70 | 79 | 22 | 11 | 70 | 11 |
| The remoteDescription read-only property of the RTCPeerConnection interface returns a RTCSessionDescription describing the session (which includes configuration and media information) for the remote end of the connection. If this hasn't been set yet, this is null. | 24 | 15 | 22 | 11 | 25 | 11 |
| The removeTrack() method of the RTCPeerConnection interface tells the local end of the connection to stop sending media from the specified track, without actually removing the corresponding RTCRtpSender from the list of senders as reported by RTCPeerConnection.getSenders(). If the track is already stopped, or is not in the connection's senders list, this… | 64 | 79 | 22 | 11 | 64 | 11 |
| The restartIce() method of the RTCPeerConnection interface allows a web application to request that ICE candidate gathering be redone on both ends of the connection. This simplifies the process by allowing the same method to be used by either the caller or the receiver to trigger an ICE restart. | 77 | 79 | 70 | 14.1 | 77 | 14.5 |
| The RTCPeerConnection() constructor returns a newly-created RTCPeerConnection, which represents a connection between the local device and a remote peer. | 56 | 15 | 44 | 11 | 56 | 11 |
RTCPeerConnection (configuration bundlePolicy parameter) `configuration.bundlePolicy` parameter | 42 | 79 | 42 | 11 | 42 | 11 |
RTCPeerConnection (configuration certificates parameter) `configuration.certificates` parameter | 49 | 79 | 42 | 12.1 | 49 | 12.2 |
RTCPeerConnection (configuration iceCandidatePoolSize parameter) `configuration.iceCandidatePoolSize` parameter | 59 | 79 | | 11 | 59 | 11 |
RTCPeerConnection (configuration iceServers parameter) `configuration.iceServers` parameter | 45 | 79 | 22 | 11 | 45 | 11 |
RTCPeerConnection (configuration iceServers parameter credential parameter) `configuration.iceServers.credential` parameter | 45 | 79 | 22 | 11 | 45 | 11 |
RTCPeerConnection (configuration iceServers parameter urls parameter) `configuration.iceServers.urls` parameter | 45 | 79 | 37 | 11 | 45 | 11 |
RTCPeerConnection (configuration iceServers parameter username parameter) `configuration.iceServers.username` parameter | 45 | 79 | 23 | 11 | 45 | 11 |
RTCPeerConnection (configuration iceTransportPolicy parameter) `configuration.iceTransportPolicy` parameter | 56 | 79 | 42 | 11 | 56 | 11 |
RTCPeerConnection (configuration peerIdentity parameter) `configuration.peerIdentity` parameter | | | 32 | | | |
RTCPeerConnection (configuration rtcpMuxPolicy parameter) `configuration.rtcpMuxPolicy` parameter | 57 | 79 | | 12.1 | 57 | 12.2 |
| The setConfiguration() method of the RTCPeerConnection interface sets the current configuration of the connection based on the values included in the specified object. This lets you change the ICE servers used by the connection and which transport policies to use. | 48 | 79 | 99 | 11 | 48 | 11 |
| The setLocalDescription() method of the RTCPeerConnection interface changes the local description associated with the connection. This description specifies the properties of the local end of the connection, including the media format. The method takes a single parameter—the session description—and it returns a Promise which is fulfilled once the… | 24 | 15 | 22 | 11 | 25 | 11 |
setLocalDescription (description parameter optional) `description` parameter is optional | 80 | 80 | 75 | 14.1 | 80 | 14.5 |
setLocalDescription (returns promise) Returns a `Promise` | 50 | 79 | 37 | 11 | 50 | 11 |
| The setRemoteDescription() method of the RTCPeerConnection interface sets the specified session description as the remote peer's current offer or answer. The description specifies the properties of the remote end of the connection, including the media format. The method takes a single parameter—the session description—and it returns a Promise which is… | 24 | 15 | 22 | 11 | 25 | 11 |
setRemoteDescription (implicit rollback) Implicit rollback | 80 | 80 | 70 | 15.4 | 80 | 15.4 |
setRemoteDescription (returns promise) Returns a `Promise` | 50 | 79 | 37 | 11 | 50 | 11 |
| The signalingState read-only property of the RTCPeerConnection interface returns a string value describing the state of the signaling process on the local end of the connection while connecting or reconnecting to another peer. See Signaling in our WebRTC session lifetime page. | 26 | 15 | 24 | 11 | 26 | 11 |
| A signalingstatechange event is sent to an RTCPeerConnection to notify it that its signaling state, as indicated by the RTCPeerConnection.signalingState property, has changed. | 28 | 15 | 36 | 11 | 28 | 11 |
| The track event is sent to the ontrack event handler on RTCPeerConnections after a new track has been added to an RTCRtpReceiver which is part of the connection. | 64 | 79 | 22 | 11 | 64 | 11 |
| The RTCPeerConnectionIceErrorEvent interface of the WebRTC API describes an error that occurred while handling ICE negotiation through a STUN or TURN server. | 77 | 79 | 150 | 14.1 | 77 | 14.5 |
| The address property of the RTCPeerConnectionIceErrorEvent interface is a string that indicates the local IP address used to communicate with the STUN or TURN server when the error occurred. | 81 | 81 | 150 | 14.1 | 81 | 14.5 |
errorCode | 77 | 79 | 150 | 14.1 | 77 | 14.5 |
errorText | 77 | 79 | 150 | 14.1 | 77 | 14.5 |
port | 81 | 81 | 150 | 14.1 | 81 | 14.5 |
RTCPeerConnectionIceErrorEvent `RTCPeerConnectionIceErrorEvent()` constructor | 77 | 79 | 150 | 14.1 | 77 | 14.5 |
url | 77 | 79 | 150 | 14.1 | 77 | 14.5 |
| The RTCPeerConnectionIceEvent interface represents events that occur in relation to ICE candidates with the target, usually an RTCPeerConnection. | 56 | 15 | 24 | 12 | 56 | 12 |
| The read-only candidate property of the RTCPeerConnectionIceEvent interface returns the RTCIceCandidate associated with the event. | 24 | 15 | 24 | 12 | 25 | 12 |
| The RTCPeerConnectionIceEvent() constructor creates a new RTCPeerConnectionIceEvent object. | 56 | 15 | 24 | 12 | 56 | 12 |
| The RTCRtpReceiver interface of the WebRTC API manages the reception and decoding of data for a MediaStreamTrack on an RTCPeerConnection. | 59 | 12 | 34 | 11 | 59 | 11 |
createEncodedStreams | 86 | 86 | | | 86 | |
| The static method RTCRtpReceiver.getCapabilities() returns an object describing the codec and header extension capabilities supported by RTCRtpReceiver objects on the current device. | 59 | 12 | 113 | 12.1 | 59 | 12.2 |
| The getContributingSources() method of the RTCRtpReceiver interface returns an array of objects, each corresponding to one CSRC (contributing source) identifier received by the current RTCRtpReceiver in the last ten seconds. | 59 | 12 | 59 | 12.1 | 59 | 12.2 |
getContributingSources (audio tracks supported) Audio tracks supported | 59 | 12 | 59 | 12.1 | 59 | 12.2 |
getContributingSources (audioLevel) `audioLevel` property in returned object | 73 | 79 | 59 | 12.1 | 73 | 12.2 |
getContributingSources (rtpTimestamp) `rtpTimestamp` property in returned object | 76 | 79 | 72 | | 76 | |
getContributingSources (source) `source` property in returned object | 59 | 79 | 59 | 12.1 | 59 | 12.2 |
getContributingSources (timestamp) `timestamp` property in returned object | 59 | 79 | 59 | 12.1 | 59 | 12.2 |
getContributingSources (video tracks supported) Video tracks supported | 73 | 79 | 68 | 12.1 | 73 | 12.2 |
| The getParameters() method of the RTCRtpReceiver interface returns an object describing the current configuration for how the receiver's RTCRtpReceiver.track is decoded. | 59 | 79 | 128 | 11 | 59 | 11 |
| An array of objects describing the media codecs that the receiver is ready to use. This is the subset of codecs that the receiver has indicated it prefers and that the remote endpoint has indicated it is prepared to send. This parameter cannot be changed once initially set. | 69 | 79 | 128 | 11 | 69 | 11 |
| An array of zero or more RTP header extensions, each identifying an extension supported by the sender or receiver. Header extensions are described in . This parameter cannot be changed once initially set. | 69 | 79 | | 11 | 69 | 11 |
| An RTCRtcpParameters object providing the configuration parameters used for RTCP on the sender or receiver. This parameter cannot be changed once initially set. | 69 | 79 | | 15 | 69 | 15 |
| The getSynchronizationSources() method of the RTCRtpReceiver interface returns an array of objects, each corresponding to one SSRC (synchronization source) identifier received by the current RTCRtpReceiver in the last ten seconds. | 73 | 79 | 59 | 12.1 | 73 | 12.2 |
getSynchronizationSources (audio tracks supported) Audio tracks supported | 73 | 79 | 59 | 12.1 | 73 | 12.2 |
getSynchronizationSources (video tracks supported) Video tracks supported | 73 | 79 | 68 | 12.1 | 73 | 12.2 |
| The jitterBufferTarget property of the RTCRtpReceiver interface is a DOMHighResTimeStamp that indicates the application's preferred duration, in milliseconds, for which the jitter should hold media before playing it out. | 124 | 124 | 115 | | 124 | |
| The track read-only property of the RTCRtpReceiver interface returns the MediaStreamTrack associated with the current RTCRtpReceiver instance. | 59 | 12 | 34 | 11 | 59 | 11 |
| The read-only transport property of an RTCRtpReceiver object provides the RTCDtlsTransport object used to interact with the underlying transport over which the receiver is exchanging Real-time Transport Control Protocol (RTCP) packets. | 59 | 12 | 82 | 15.4 | 59 | 15.4 |
| The RTCRtpSender interface provides the ability to control and obtain details about how a particular MediaStreamTrack is encoded and sent to a remote peer. | 64 | 13 | 34 | 11 | 64 | 11 |
createEncodedStreams | 86 | 86 | | | 86 | |
| The read-only dtmf property on the RTCRtpSender interface returns a RTCDTMFSender object which can be used to send DTMF tones over the RTCPeerConnection. See Using DTMF for details on how to make use of the returned RTCDTMFSender object. | 66 | 79 | 52 | 13.1 | 66 | 13.4 |
| The static method RTCRtpSender.getCapabilities() returns an object describing the codec and header extension capabilities supported by the RTCRtpSender. | 69 | 13 | 113 | 12.1 | 69 | 12.2 |
| The getParameters() method of the RTCRtpSender interface returns an object describing the current configuration for how the sender's RTCRtpSender.track will be encoded and transmitted to a remote RTCRtpReceiver. | 68 | 79 | 46 | 11 | 68 | 11 |
| An array of objects describing the media codecs that the sender has set as enabled, and is prepared to use. This parameter cannot be changed once initially set. | 69 | 79 | 128 | 11 | 69 | 11 |
| An array of objects, each specifying the parameters and settings for a single codec that could be used to encode the track's media. The properties of the objects include: | 69 | 79 | 46 | 12.1 | 69 | 12.2 |
| An array of zero or more RTP header extensions, each identifying an extension supported by the sender or receiver. Header extensions are described in . This parameter cannot be changed once initially set. | 69 | 79 | 46 | 11 | 69 | 11 |
| An object providing the configuration parameters used for RTCP on the sender. This parameter cannot be changed. | 69 | 79 | 46 | 15 | 69 | 15 |
| A string containing a unique ID. This value is used to ensure that RTCRtpSender.setParameters can only be called to modify the parameters returned by a specific previous call to getParameters(). This parameter cannot be changed by the caller. <!-- spec defines following in RTCRtpParameters --> | 69 | 79 | 110 | 12.1 | 69 | 12.2 |
| The RTCRtpSender method replaceTrack() replaces the track currently being used as the sender's source with a new MediaStreamTrack. | 65 | 79 | 34 | 11 | 65 | 11 |
| The setParameters() method of the RTCRtpSender interface applies changes the configuration of sender's RTCRtpSender.track, which is the MediaStreamTrack for which the RTCRtpSender is responsible. | 68 | 79 | 64 | 11 | 68 | 11 |
| An array of objects describing the media codecs from which the sender will choose. This parameter cannot be changed once initially set. | 69 | 79 | 128 | 12.1 | 69 | 12.2 |
| An array of objects, each specifying the parameters for a single codec that could be used to encode the track's media. The properties of the objects include: | 69 | 79 | 46 | 11 | 69 | 11 |
setParameters (parameters encodings parameter active) `parameters.encodings.active` parameter | 69 | 79 | 110 | 11.1 | 69 | 11.3 |
setParameters (parameters encodings parameter maxBitrate) `parameters.encodings.maxBitrate` parameter | 69 | 79 | 46 | 11 | 69 | 11 |
setParameters (parameters encodings parameter maxFramerate) `parameters.encodings.maxFramerate` parameter | 81 | 81 | 101 | 11 | 81 | 11 |
setParameters (parameters encodings parameter rid) `parameters.encodings.rid` parameter | | | 46 | | | |
setParameters (parameters encodings parameter scaleResolutionDownBy) `parameters.encodings.scaleResolutionDownBy` parameter | 74 | 79 | 46 | 11 | 74 | 11 |
| An array of zero or more RTP header extensions, each identifying an extension supported by the sender. Header extensions are described in . This parameter cannot be changed. | 69 | 79 | 46 | 12.1 | 69 | 12.2 |
| An object providing the configuration parameters used for RTCP on the sender. This parameter cannot be changed. | 69 | 79 | 46 | 15 | 69 | 15 |
| A string containing a unique ID. This ID is set in the previous RTCRtpSender.getParameters call, and ensures that the parameters originated from a previous call to RTCRtpSender.getParameters. <!-- spec defines following in RTCRtpParameters --> | 69 | 79 | 110 | 12.1 | 69 | 12.2 |
| The RTCRtpSender method setStreams() associates the sender's RTCRtpSender.track with the specified MediaStream objects. | 76 | 79 | 113 | 14.1 | 76 | 14.5 |
| The track read-only property of the RTCRtpSender interface returns the MediaStreamTrack which is being handled by the RTCRtpSender. | 64 | 13 | 34 | 11 | 64 | 11 |
| The read-only transport property of an RTCRtpSender object provides the RTCDtlsTransport object used to interact with the underlying transport over which the sender is exchanging Real-time Transport Control Protocol (RTCP) packets. | 75 | 13 | 82 | 15.4 | 75 | 15.4 |
| The WebRTC interface RTCRtpTransceiver describes a permanent pairing of an RTCRtpSender and an RTCRtpReceiver, along with some shared state. | 69 | ≤18 | 59 | 11 | 69 | 11 |
| The read-only RTCRtpTransceiver property currentDirection is a string which indicates the current negotiated directionality of the transceiver. | 69 | 79 | 59 | 12.1 | 69 | 12.2 |
currentDirection (stopped value) `"stopped"` value | 103 | 103 | 118 | | 103 | |
| The RTCRtpTransceiver property direction is a string that indicates the transceiver's preferred directionality. | 69 | 79 | 59 | 11 | 69 | 11 |
direction (value stopped) `"stopped"` value | 103 | 103 | 118 | | 103 | |
getHeaderExtensionsToNegotiate Experimental | 117 | 117 | | | 117 | |
getNegotiatedHeaderExtensions Experimental | 117 | 117 | | | 117 | |
| The read-only RTCRtpTransceiver interface's mid property specifies the negotiated media ID (mid) which the local and remote peers have agreed upon to uniquely identify the stream's pairing of sender and receiver. | 69 | 79 | 59 | 11 | 69 | 11 |
| The read-only receiver property of WebRTC's RTCRtpTransceiver interface indicates the RTCRtpReceiver responsible for receiving and decoding incoming media data for the transceiver's stream. | 69 | 79 | 59 | 11 | 69 | 11 |
| The read-only sender property of WebRTC's RTCRtpTransceiver interface indicates the RTCRtpSender responsible for encoding and sending outgoing media data for the transceiver's stream. | 69 | 79 | 59 | 11 | 69 | 11 |
| The setCodecPreferences() method of the RTCRtpTransceiver interface is used to set the codecs that the transceiver allows for decoding received data, in order of decreasing preference. | 76 | 79 | 128 | 13.1 | 76 | 13.4 |
setHeaderExtensionsToNegotiate Experimental | 117 | 117 | | | 117 | |
| The stop() method in the RTCRtpTransceiver interface permanently stops the transceiver by stopping both the associated RTCRtpSender and RTCRtpReceiver. | 88 | 88 | 59 | 11 | 88 | 11 |
| The RTCSessionDescription interface describes one end of a connection—or potential connection—and how it's configured. Each RTCSessionDescription consists of a description RTCSessionDescription.type indicating which part of the offer/answer negotiation process it describes and of the SDP descriptor of the session. | 23 | 15 | 44 | 11 | 25 | 11 |
| The property RTCSessionDescription.sdp is a read-only string containing the SDP which describes the session. | 23 | 15 | 22 | 11 | 25 | 11 |
| The RTCSessionDescription.toJSON() method generates a JSON description of the object. Both properties, RTCSessionDescription.type and RTCSessionDescription.sdp, are contained in the generated JSON. | 43 | 15 | 24 | 11 | 43 | 11 |
| The property RTCSessionDescription.type is a read-only string value which describes the description's type. | 23 | 15 | 22 | 11 | 25 | 11 |
| The WebRTC API interface RTCTrackEvent represents the RTCPeerConnection.track_event event, which is sent when a new MediaStreamTrack is added to an RTCRtpReceiver which is part of the RTCPeerConnection. | 56 | 79 | 22 | 11 | 56 | 11 |
| The read-only receiver property of the RTCTrackEvent interface indicates the RTCRtpReceiver which is used to receive data containing media for the RTCTrackEvent.track to which the event refers. | 56 | 79 | 34 | 11 | 56 | 11 |
| The RTCTrackEvent() constructor creates and returns a new RTCTrackEvent object, configured to describe the track which has been added to the RTCPeerConnection. | 64 | 79 | 46 | 11 | 64 | 11 |
| The WebRTC API interface RTCTrackEvent's read-only streams property specifies an array of MediaStream objects, one for each of the streams that comprise the track being added to the RTCPeerConnection. | 56 | 79 | 22 | 11 | 56 | 11 |
| The WebRTC API interface RTCTrackEvent's read-only track property specifies the MediaStreamTrack that has been added to the RTCPeerConnection. | 56 | 79 | 22 | 11 | 56 | 11 |
| The WebRTC API interface RTCTrackEvent's read-only transceiver property indicates the RTCRtpTransceiver affiliated with the event's RTCTrackEvent.track. | 69 | 79 | 59 | 11 | 69 | 11 |
- The default for `rtcpMuxPolicy` is `require`.
- The default for `rtcpMuxPolicy` is `require`.
- The default for `rtcpMuxPolicy` is `require`.
- This feature was removed in a later browser version (79)
- Previously available under a different name: transport (15)
- This feature was removed in a later browser version (79)
- Previously available under a different name: dtlsstatechange (12)
- Available with a vendor prefix: moz (22)
- Before Firefox 126, the property was not read-only.
- See bug 1886013.
- Before Firefox 68, the constructor's `candidateInfo` parameter is required and the `candidateInfo` object must have a `candidate` property.
- Available with a vendor prefix: moz (22)
- Before Firefox 126, the property was not read-only.
- Before Firefox 126, the property was not read-only.
- See bug 1886013.
- Before Firefox 126, the property was not read-only.
- This feature was removed in a later browser version (79)
- Previously available under a different name: getNominatedCandidatePair (13)
- Available with a vendor prefix: webkit (23)
- Available with a vendor prefix: webkit (15)
- Available with a vendor prefix: moz (22)
- Available with a vendor prefix: webkit (25)
- Starting in Firefox 68, the `candidate` parameter is optional when calling `addIceCandidate()`. A `null` value for `candidate` indicates no more candidates will be sent, while an empty `candidate` string indicates that no more candidates will be sent for the current generation of candidates.
- This feature was removed in a later browser version (79)
- This browser only partially implements this feature
- This feature was removed in a later browser version (38)
- Although the `onnegotiationneeded` property is supported, the `negotiationneeded` event is never fired.
- Before Chrome 63, the default value for the `configuration.rtcpMuxPolicy` parameter is `"negotiate"` instead of `"required"`.
- Available with a vendor prefix: webkit (23)
- Available with a vendor prefix: webkit (15)
- Available with a vendor prefix: moz (22)
- Before Chrome Android 63, the default value for the `configuration.rtcpMuxPolicy` parameter is `"negotiate"` instead of `"required"`.
- Available with a vendor prefix: webkit (25)
- Previously available under a different name: iceTransports (38)
- Previously available under a different name: iceTransports (79)
- Previously available under a different name: iceTransports (38)
- Default for `rtcpMuxPolicy` is `require`
- Default for `rtcpMuxPolicy` is `require`
- Firefox does not support descriptions of type `pranswer`.
- This browser only partially implements this feature
- This feature was removed in a later browser version (36)
- Although the `onsignalingstatechange` property is supported, the `signalingstatechange` event is not fired as an `Event` object. See bug 1075133.
- This feature was removed in a later browser version (56)
- Previously available under a different name: RTCIceCandidateEvent (24)
- This feature was removed in a later browser version (56)
- Previously available under a different name: RTCIceCandidateEvent (25)
- Starting in version 60, the `timestamp` is correctly computed based on the window's `Performance` time, rather than `Date.getTime()`.
- This browser only partially implements this feature
- This feature was removed in a later browser version (128)
- The property is defined but not implemented/used.
- This browser only partially implements this feature
- The property is defined but not implemented/used.
- This browser only partially implements this feature
- The property is defined but not implemented/used.
- This browser only partially implements this feature
- This feature was removed in a later browser version (64)
- Before Firefox 64, changes to parameters that should update live would not do so.
- This browser only partially implements this feature
- This feature was removed in a later browser version (128)
- The property is defined but not implemented/used.
- This browser only partially implements this feature
- Zero is treated as 'no fps limit' (see bug 1611957).
- This browser only partially implements this feature
- The property is defined but not implemented/used.
- This browser only partially implements this feature
- The property is defined but not implemented/used.
- Available with a vendor prefix: moz (22)
Use cases
-
Using WebRTC
The RTCCertificate interface of the WebRTC API provides an object representing a certificate that an RTCPeerConnection uses to authenticate.
Cautions
- May not be supported in older browsers.
Implementation notes
- Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.