Table of Contents

Class RTCIceTransport

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The RTCIceTransport interface provides access to information about the ICE transport layer over which the data is being sent and received.
This is particularly useful if you need to access state information about the connection.

[Value("RTCIceTransport")]
public class RTCIceTransport : EventTarget
Inheritance
RTCIceTransport
Inherited Members

Remarks

Constructors

RTCIceTransport()

public RTCIceTransport()

Properties

Component

The component read-only property of the RTCIceTransport interface specifies whether the object is serving to transport {{Glossary("RTP")}} or {{Glossary("RTCP")}}.

[Value("component")]
public RTCIceComponent Component { get; }

Property Value

RTCIceComponent

A string which is one of the following:

Remarks

GatheringState

The gatheringState read-only property of the RTCIceTransport interface returns a string that indicates the current gathering state of the ICE agent for this transport: "new", "gathering", or "complete".

[Value("gatheringState")]
public RTCIceGathererState GatheringState { get; }

Property Value

RTCIceGathererState

A string that indicates the current state of the ICE agent's candidate gathering process:

Remarks

You can detect when the value of this property changes by watching for an event of type RTCIceTransportgatheringstatechange.

Note that gatheringState represents the gathering state of just this transport, while IceGatheringState represents the overall gathering state of the whole connection, including every RTCIceTransport used by every RTCRtpSender and every RTCRtpReceiver on the entire connection.

See also on MDN

Onerror

[Value("onerror")]
public EventHandlerNonNull Onerror { get; set; }

Property Value

EventHandlerNonNull

Ongatheringstatechange

[Value("ongatheringstatechange")]
public EventHandlerNonNull Ongatheringstatechange { get; set; }

Property Value

EventHandlerNonNull

Onicecandidate

[Value("onicecandidate")]
public EventHandlerNonNull Onicecandidate { get; set; }

Property Value

EventHandlerNonNull

Onselectedcandidatepairchange

[Value("onselectedcandidatepairchange")]
public EventHandlerNonNull Onselectedcandidatepairchange { get; set; }

Property Value

EventHandlerNonNull

Onstatechange

[Value("onstatechange")]
public EventHandlerNonNull Onstatechange { get; set; }

Property Value

EventHandlerNonNull

Role

The role read-only property of the RTCIceTransport interface indicates which {{Glossary("ICE")}} role the transport is fulfilling: that of the controlling agent, or the agent that is being controlled.

[Value("role")]
public RTCIceRole Role { get; }

Property Value

RTCIceRole

A string specifying whether the RTCIceTransport represents the controlling agent or the controlled agent.The value must be one of the following:

Remarks

You can learn more about ICE roles in Choosing a candidate pair.

See also on MDN

State

The state read-only property of the RTCIceTransport interface 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.

[Value("state")]
public RTCIceTransportState State { get; }

Property Value

RTCIceTransportState

A string whose value is one of the following:

Remarks

This differs from the GatheringState, which only indicates whether or not ICE gathering is currently underway.
It also differs from ConnectionState, which aggregates the states across every RTCIceTransport used by every RTCRtpSender and every RTCRtpReceiver on the entire connection.

See also on MDN

Methods

AddRemoteCandidate(RTCIceCandidateInit)

[Value("addRemoteCandidate")]
public GlobalObject.Undefined AddRemoteCandidate(RTCIceCandidateInit remoteCandidate = null)

Parameters

remoteCandidate RTCIceCandidateInit

Returns

GlobalObject.Undefined

Gather(RTCIceGatherOptions)

[Value("gather")]
public GlobalObject.Undefined Gather(RTCIceGatherOptions options = null)

Parameters

options RTCIceGatherOptions

Returns

GlobalObject.Undefined

GetLocalCandidates()

The getLocalCandidates() method of the RTCIceTransport interface returns an array of RTCIceCandidate objects, one for each of the candidates that have been gathered by the local device during the current {{Glossary("ICE")}} agent session.

[Value("getLocalCandidates")]
public List<RTCIceCandidate> GetLocalCandidates()

Returns

List<RTCIceCandidate>

A JavaScript {{jsxref("Array")}} containing one RTCIceCandidate object for each candidate that has been identified so far during the ICE candidate gathering session.You can&apos;t correlate these local candidates with matching remote candidates.
To find the best match found so far, call GetSelectedCandidatePair().

Remarks

The local candidates are placed in this list by the ICE agent prior to being delivered to the local client's code in an RTCPeerConnection.Icecandidate event so that the client can forward the candidates to the remote peer.

See also on MDN

GetLocalParameters()

The getLocalParameters() method of the RTCIceTransport interface returns an RTCIceParameters object that provides information uniquely identifying the local peer for the duration of the ICE session.

[Value("getLocalParameters")]
public RTCIceParameters? GetLocalParameters()

Returns

RTCIceParameters

An RTCIceParameters object indicating the UsernameFragment and Password which uniquely identify the local peer for the duration of the ICE session.Returns null if the parameters have not yet been received.

Remarks

The local peer's parameters are obtained during ICE signaling and delivered to the transport when the client calls SetLocalDescription(RTCLocalSessionDescriptionInit).

See also on MDN

GetRemoteCandidates()

The getRemoteCandidates() method of the RTCIceTransport interface returns an array that contains one RTCIceCandidate for each of the candidates that have been received from the remote peer so far during the current {{Glossary("ICE")}} gathering session.

[Value("getRemoteCandidates")]
public List<RTCIceCandidate> GetRemoteCandidates()

Returns

List<RTCIceCandidate>

An array containing one RTCIceCandidate object for each candidate that has been received so far from the remote peer during the current ICE candidate gathering session.It&apos;s important to keep in mind that there&apos;s no way to correlate these remote candidates with compatible local candidates.
To find the best match found so far, call GetSelectedCandidatePair().

Remarks

Each time your signaling code calls AddIceCandidate(RTCIceCandidateInit) to add a received candidate to the ICE session, the ICE agent places it in the list returned by this function.

See also on MDN

GetRemoteParameters()

The getRemoteParameters() method of the RTCIceTransport interface returns an RTCIceParameters object that provides information uniquely identifying the remote peer for the duration of the ICE session.

[Value("getRemoteParameters")]
public RTCIceParameters? GetRemoteParameters()

Returns

RTCIceParameters

An RTCIceParameters object indicating the UsernameFragment and Password which uniquely identify the remote peer for the duration of the ICE session.Returns null if the parameters haven&apos;t been received yet.

Remarks

The remote peer's parameters are received during ICE signaling and delivered to the transport when the client calls SetRemoteDescription(RTCSessionDescriptionInit).

See also on MDN

GetSelectedCandidatePair()

The getSelectedCandidatePair() method of the RTCIceTransport interface returns an RTCIceCandidatePair object containing the current best-choice pair of {{Glossary("ICE")}} candidates describing the configuration of the endpoints of the transport.

[Value("getSelectedCandidatePair")]
public RTCIceCandidatePair? GetSelectedCandidatePair()

Returns

RTCIceCandidatePair

A RTCIceCandidatePair object describing the configurations of the currently-selected candidate pair's two endpoints.
Local describes the configuration of the local end of the connection, while Remote describes the remote peer's configuration.The return value is null if no pair of candidates has been selected yet.

Remarks

Start(RTCIceParameters, RTCIceRole)

[Value("start")]
public GlobalObject.Undefined Start(RTCIceParameters remoteParameters = null, RTCIceRole role = RTCIceRole.Unknown)

Parameters

remoteParameters RTCIceParameters
role RTCIceRole

Returns

GlobalObject.Undefined

Stop()

[Value("stop")]
public GlobalObject.Undefined Stop()

Returns

GlobalObject.Undefined