The RTCIceCandidate() constructor creates and returns a new RTCIceCandidate object, which can be configured to represent a single ICE candidate.


candidate = new RTCIceCandidate([candidateInfo]);


candidateInfo Optional
An optional RTCIceCandidateInit object providing information about the candidate; if this is provided, the candidate is initialized configured to represent the described candidate.

Return value

A newly-created RTCIceCandidate object, optionally configured based on the specified object based on the RTCIceCandidateInit dictionary.

If candidateInfo is provided, the new RTCIceCandidate is initialized as follows:

Note: Parsing of the candidate string is performed using the candidate-attribute grammar from the WebRTC Specification.


The specified RTCIceCandidateInit has values of null in both the sdpMid and sdpMLineIndex properties.

Usage notes

This constructor does not do complete validation of the specified candidateInfo object or string.


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

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
RTCIceCandidate()Chrome Full support YesEdge Full support YesFirefox Full support 22IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android ? Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes


Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also


Document Tags and Contributors

Contributors to this page: mdnwebdocs-bot, Sheppy
Last updated by: mdnwebdocs-bot,