只读
RTCIceTransport
property
state
returns the current state of the ICE transport, so you can determine the state of ICE gathering in which the ICE agent currently is operating.
This differs from the
gatheringState
, which only indicates whether or not ICE gathering is currently underway.
iceState = iceTransport.state;
A
DOMString
, whose value is one of those found in the enumerated type
RTCIceTransportState
, which indicates the stage of ICE gathering that's currently underway. Its value will be one of the following:
"new"
RTCIceTransport
is currently gathering local candidates, or is waiting for the remote device to begin to transmit the remote candidates, or both. In this state, checking of candidates to look for those which might be acceptable has not yet begun.
"checking"
RTCIceTransport
has begun examining pairings of remote and local candidates in order to attempt to identify viable pairs that could be used to establish a connection. Keep in mind that gathering of local candidates may still be underway, and, similarly, the remote device also may still be gathering candidates of its own.
"connected"
A viable candidate pair has been found and selected, and the
RTCIceTransport
has connected the two peers together using that pair. However, there are still candidates pairings to consider, and there may still be gathering underway on one or both of the two devices.
The transport may revert from the
"connected"
state to the
"checking"
state if either peer decides to cancel consent to use the selected candidate pair, and may revert to
"disconnected"
if there are no candidates left to check but one or both clients are still gathering candidates.
"completed"
"failed"
.
"disconnected"
RTCIceTransport
. This is not a failure state (that's
"failed"
). A value of
"disconnected"
means that a transient issue has occurred that has broken the connection, but that should resolve itself automatically without your code having to take any action. See
The disconnected state
了解额外细节。
"failed"
RTCIceTransport
has finished the gathering process, has received the "no more candidates" notification from the remote peer, and has finished checking pairs of candidates, without successfully finding a pair that is both valid and for which consent can be obtained.
This is a terminal state, indicating that the connection cannot be achieved or maintained.
"closed"
The transport has shut down and is no longer responding to STUN requests.
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCIceTransportState' in that specification. |
候选推荐 | 初始定义。 |
No compatibility data found. Please contribute data for "api.RTCIceTransportState" (depth: 1) to the MDN 兼容性数据存储库 .
RTCIceTransport
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent