RTCIceCandidateInit

You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!

The WebRTC API's RTCIceCandidateInit dictionary, which contains the information needed to fundamentally describe an RTCIceCandidate. RTCIceCandidateInit is used when using new RTCIceCandidate() to create a new ICE candidate object. It's also used as the return value from the RTCIceCandidate.toJSON() method, and can be passed directly into RTCPeerConnection.addIceCandidate() to add a candidate to the peer connection.

Properties

candidate Optional
The ICE candidate-attribute. If the candidate is an indicator that there are no further candidates (rather than representing a new candidate), this is the empty string (""). The default is the empty string.
sdpMid Optional
The identification tag of the media stream with which the candidate is associated, or null if there is no associated media stream. The default is null.
sdpMLineIndex Optional
The zero-based index of the m-line within the SDP of the media description with which the candidate is associated, or null if no such associated exists. The default is null.
usernameFragment Optional
A DOMString containing a string which uniquely identifies the remote peer. This string is generated by WebRTC at the beginning of the session, and at least 24 bits worth of the string contain random data. The string may be up to 256 characters long. This property has no default value and is not present unless set explicitly.

Specifications

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

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
RTCIceCandidateInitChrome Full support YesEdge Full support YesFirefox Full support 22IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
candidateChrome Full support YesEdge Full support YesFirefox Full support 22
Notes
Full support 22
Notes
Notes Prior to Firefox 68, the candidate property was required; Firefox 68 and later make it optional per a mid-2017 specification update.
IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support Yes
Notes
Full support Yes
Notes
Notes Prior to Firefox 68, the candidate property was required; Firefox 68 and later make it optional per a mid-2017 specification update.
Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
sdpMidChrome Full support YesEdge Full support YesFirefox Full support 22IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
sdpMLineIndexChrome Full support YesEdge Full support YesFirefox Full support 22IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
usernameFragmentChrome Full support YesEdge Full support YesFirefox Full support 67IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 67Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.