state property

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

The current state of the ICE transport.

The first time start() is called, candidate connectivity checks are started and the ICE transport attempts to connect to the remote RTCIceTransport. If start() is called with invalid parameters, throw an InvalidParameters exception. For example, if gatherer.component has a value different from iceTransport.component, throw an InvalidParameters exception. If state is "closed", throw an InvalidStateError exception. When start() is called again, RTCIceTransportState transitions to the "connected" state, all remote candidates are flushed, and addRemoteCandidate() or setRemoteCandidates() must be called to add the remote candidates back or replace them.

Parameter Type Nullable Optional
gatherer RTCIceGatherer X X
remoteParameters RTCIceParameters X X
role RTCIceRole X

 

This property is read-only.

Syntax

JavaScript

state = object.state

 

Property values

Type: RTCIceTransportState

Represents the current state of the ICE transport.

Value Condition
new

The RTCIceTransport object is waiting for remote candidates to be supplied. In this state the object can respond to incoming connectivity checks.

checking

The RTCIceTransport has received at least one remote candidate, and a local and remote RTCIceCandidateComplete dictionary was not added as teh last candidate. In this state the RTCIceTransport is checking candidate pairs but has not yet found a successful candidate pair, or liveness checks have failed (such as those in [CONSENT]) on a previously successful candidate pair.

connected

The RTCIceTransport has received a response to an outgoing connectivity check, or has received incoming DTLS/media after a successful response to an incoming connectivity check, but is still checking other candidate pairs to see if there is a better connection. In this state outgoing media is permitted.

completed

A local and remote RTCIceCandidateComplete dictionary was added as the last candidate to the RTCIceTransport and all appropriate candidate pairs have been tested and at least one functioning candidate pair has been found.

disconnected

The RTCIceTransport has received at least one local and remote candidate, and a local and remote RTCIceCandidateComplete dictionary was not added as the last candidate, but all appropriate candidate pairs thus far have been tested and failed (or consent checks [CONSENT], once successful, have now failed). Other candidate pairs may become available for testing as new candidates are trickled, and therefore the "failed" state has not been reached.

closed

The RTCIceTransport has shut down and is no longer responding to STUN requests.

 

Standards information

Note  Edge Interop Note: The Microsoft Edge ORTC API implementation does not support the "failed" state, which is included in both the WebRTC 1.0 API as well as recent drafts of the ORTC API. One implication of this is that RTCIceTransport objects transition to the "closed" state under the conditions that would normally result in a transition to "failed".

 

Remarks

The non-normative ICE state transitions are:

Non-normative ICE state transitions diagram

See also

RTCIceTransport