We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE


This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

When a web site or app using RTCPeerConnection receives a new ICE candidate from the remote peer over its signaling channel, it delivers the newly-received candidate to the browser's ICE agent by calling RTCPeerConnection.addIceCandidate(). This adds this new remote candidate to the RTCPeerConnection's remote description, which describes the state of the remote end of the connection.

If the value of the specified object's candidate is an empty string (""), it signals that all remote candidates have been delivered.

During negotiation, your app will likely receive many candidates which you'll deliver to the ICE agent in this way, allowing it to build up a list of potential connection methods. This is covered in more detail in the articles WebRTC connectivity and Signaling and video calling.


aPromise = pc.addIceCandidate(candidate);

addIceCandidate(candidate, successCallback, failureCallback);  


An object conforming to the RTCIceCandidateInit dictionary; the contents of the object should be constructed from a message received over the signaling channel, describing a newly received ICE candidate that's ready to be delivered to the local ICE agent.

Deprecated parameters

In older code and documentation, you may see a callback-based version of this function. This has been deprecated and its use is strongly discouraged. You should update any existing code to use the Promise-based version of addIceCandidate() instead. The parameters for this form of addIceCandidate() are described below, to aid in updating existing code.

A function to be called when the ICE candidate has been successfully added. This function receives no input parameters and doesn't return a value.
A function to be called if attempting to add the ICE candidate fails. Receives as input a DOMException object describing why failure occurred.

Return value

A Promise which is fulfilled when the candidate has been successfully added to the remote peer's description by the ICE agent. The promise does not receive any input parameters.


When an error occurs while attempting to add the ICE candidate, the Promise returned by this method is rejected, returning one of the errors below as the name attribute in the specified DOMException object passed to the rejection handler.

The specified candidate doesn't have values for both sdpMid and sdpMLineIndex.
The RTCPeerConnection currently has no remote peer established (remoteDescription is null).
A non-null value was specified for sdpMid, but the value doesn't match the mid of any media description in the remoteDescription, or sdpMLineIndex is greater than or equal to the number of media descriptions in remoteDescription. This error can also be thrown if a value is given for ufrag that doesn't match the value of ufrag in any of the remote description being selected.

OperationError also occurs if the attempt to add the candidate fails for any other reason.


This code snippet shows how to construct a candidate object from a string which contains SDP describing a candidate. This string previously arrived over the signaling channel.

// |receivedSDP| is an SDP string received over the signaling channel
// by our handler for "new ICE candidate" messages.

let candidate = new RTCIceCandidate(receivedSDP);

  // Do stuff when the candidate is successfully passed to the ICE agent
  console.log("Error: Failure during addIceCandidate()");


Specification Status Comment
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCPeerConnection.addIceCandidate()' in that specification.
Candidate Recommendation Initial specification.
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCPeerConnection.addIceCandidate()' in that specification.
Candidate Recommendation Initial specification.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support


50 — 562

Yes22 ?


37 — 43

FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support


50 — 562


50 — 562



37 — 43

? ?

1. Promise based version and unprefixed.

2. Promise based version.

See also

Document Tags and Contributors

 Contributors to this page: fscholz, Sheppy, jpmedley, abbycar, cauburtin, rolfedh
 Last updated by: fscholz,