我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译
您也可以阅读此文章的English (US)版。

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

The RTCPeerConnectionIceEvent interface represents events that occurs in relation to ICE candidates with the target, usually an RTCPeerConnection. Only one event is of this type: icecandidate.

Properties

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

RTCPeerConnectionIceEvent.candidate Read only
Contains the RTCIceCandidate containing the candidate associated with the event.

Constructors

RTCPeerConnectionIceEvent()
Returns a new RTCPeerConnectionIceEvent. It takes two parameters, the first being a DOMString representing the type of the event; the second a dictionary containing the RTCIceCandidate it refers to.

Methods

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

Examples

pc.onicecandidate = function( ev ) {
  alert("The ICE candidate (transport address: '" + 
    ev.candidate.candidate + 
    "') has been added to this connection.");
}

Specifications

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

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support

Yes — 561

56

Yes Yes ? Yes ?
candidate5615 Yes ? Yes ?
RTCPeerConnectionIceEvent() constructor.56 Yes Yes ? Yes ?
url ? ? ? ? ? ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support

Yes — 561

56

Yes — 561

56

? Yes Yes ?6.0
candidate5656 ? Yes Yes ?6.0
RTCPeerConnectionIceEvent() constructor.5656 ? Yes Yes ?6.0
url ? ? ? ? ? ? ?

1. Supported as RTCIceCandidateEvent.

See also

文档标签和贡献者

此页面的贡献者: fscholz, jpmedley, abbycar, teoli
最后编辑者: fscholz,