RTCPeerConnectionIceEvent
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2018.
TheRTCPeerConnectionIceEvent interface represents events that occur in relation toICE candidates with the target, usually anRTCPeerConnection.
Only one event is of this type:icecandidate.
In this article
Instance properties
ARTCPeerConnectionIceEvent being anEvent, this event also implements these properties.
RTCPeerConnectionIceEvent.candidateRead onlyContains the
RTCIceCandidatecontaining the candidate associated with the event, ornullif this event indicates that there are no further candidates to come.RTCPeerConnectionIceEvent.urlRead onlyDeprecatedContains a string indicating the URL of theSTUN orTURN server used to gather the candidate, or
nullif the candidate was not gathered from a server.
Constructors
RTCPeerConnectionIceEvent()Returns a new
RTCPeerConnectionIceEvent. It takes two parameters, the first being a string representing the type of the event; the second a dictionary containing theRTCIceCandidateit refers to.
Instance methods
ARTCPeerConnectionIceEvent being anEvent, this event also implements these properties. There is no specificRTCDataChannelEvent method.
Examples
pc.onicecandidate = (ev) => { console.log( `The ICE candidate ('${ev.candidate.candidate}') added to connection.`, );};Specifications
| Specification |
|---|
| WebRTC: Real-Time Communication in Browsers> # rtcpeerconnectioniceevent> |
Browser compatibility
See also
- WebRTC
- Its usual target:
RTCPeerConnection.