这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
The read-only property
RTCPeerConnection.iceGatheringState
returns an enum of type
RTCIceGatheringState
that describes connection's ICE gathering state. This lets you detect, for example, when collection of ICE candidates has finished.
You can detect when the value of this property changes by watching for an event of type
icegatheringstatechange
.
var state = RTCPeerConnection.iceGatheringState;
The possible values are those of an enum of type
RTCIceGatheringState
.
RTCIceGatheringState
enum defines string constants which reflect the current status of ICE gathering, as returned using the
RTCPeerConnection.iceGatheringState
property. You can detect when this value changes by watching for an event of type
icegatheringstatechange
.
| 常量 | 描述 |
|---|---|
"new"
|
The peer connection was just created and hasn't done any networking yet. |
"gathering"
|
The ICE agent is in the process of gathering candidates for the connection. |
"complete"
|
The ICE agent has finished gathering candidates. If something happens that requires collecting new candidates, such as a new interface being added or the addition of a new ICE server, the state will revert to "gathering" to gather those candidates. |
var pc = new RTCPeerConnection(); var state = pc.iceGatheringState;
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCPeerConnection.iceGatheringState' in that specification. |
候选推荐 | 最初的规范。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
iceGatheringState
|
Chrome 25 | Edge 15 | Firefox 22 | IE No |
Opera
43
|
Safari 11 | WebView Android Yes | Chrome Android 25 | Firefox Android 44 |
Opera Android
43
|
Safari iOS Yes | Samsung Internet Android 6.0 |
完整支持
不支持
见实现注意事项。
RTCPeerConnection
canTrickleIceCandidates
connectionState
currentLocalDescription
currentRemoteDescription
getDefaultIceServers()
iceConnectionState
iceGatheringState
localDescription
onaddstream
onconnectionstatechange
ondatachannel
onicecandidate
oniceconnectionstatechange
onicegatheringstatechange
onidentityresult
onidpassertionerror
onidpvalidationerror
onnegotiationneeded
onpeeridentity
onremovestream
onsignalingstatechange
ontrack
peerIdentity
pendingLocalDescription
pendingRemoteDescription
remoteDescription
sctp
signalingState
addIceCandidate()
addStream()
addTrack()
close()
createAnswer()
createDataChannel()
createOffer()
generateCertificate()
getConfiguration()
getIdentityAssertion()
getReceivers()
getSenders()
getStats()
getStreamById()
getTransceivers()
removeStream()
removeTrack()
restartIce()
setConfiguration()
setIdentityProvider()
setLocalDescription()
setRemoteDescription()
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCIceTransport
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent