MDN self-hosted library · e01.org

RTCPeerConnectionIceEvent

WebRTC

WebRTC

The RTCPeerConnectionIceEvent interface represents events that occur in relation to ICE candidates with the target, usually an RTCPeerConnection.

Only one event is of this type: icecandidate.

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 the RTCIceCandidate it refers to.

Instance properties

A RTCPeerConnectionIceEvent being an Event, this event also implements these properties.

  • RTCPeerConnectionIceEvent.candidate
  • : Contains the RTCIceCandidate containing the candidate associated with the event, or null if this event indicates that there are no further candidates to come.
  • RTCPeerConnectionIceEvent.url
  • : Contains a string indicating the URL of the STUN or TURN server used to gather the candidate, or null if the candidate was not gathered from a server.

Instance methods

A RTCPeerConnectionIceEvent being an Event, this event also implements these properties. There is no specific RTCDataChannelEvent method.

Examples

pc.onicecandidate = (ev) => {
  console.log(
    `The ICE candidate ('${ev.candidate.candidate}') added to connection.`,
  );
};

Specifications

Browser compatibility

See also

  • WebRTC
  • Its usual target: RTCPeerConnection.