Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

RTCIceTransport

Baseline2024 *
Newly available

TheRTCIceTransport interface provides access to information about theICE 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.

EventTarget RTCIceTransport

Instance properties

TheRTCIceTransport interface inherits properties from its parent,EventTarget. It also offers the following properties:

componentRead only

The ICE component being used by the transport. The value is one of the strings from theRTCIceTransport enumerated type:"RTP" or"RTSP".

gatheringStateRead only

A string indicating which current gathering state of the ICE agent:"new","gathering", or"complete".

roleRead only

Returns a string whose value is either"controlling" or"controlled"; this indicates whether the ICE agent is the one that makes the final decision as to the candidate pair to use or not.

stateRead only

A string indicating what the current state of the ICE agent is. The value ofstate can be used to determine whether the ICE agent has made an initial connection using a viable candidate pair ("connected"), made its final selection of candidate pairs ("completed"), or in an error state ("failed"), among other states.

Instance methods

Also includes methods fromEventTarget, the parent interface.

getLocalCandidates()

Returns an array ofRTCIceCandidate objects, each describing one of the ICE candidates that have been gathered so far for the local device. These are the same candidates which have already been sent to the remote peer by sending anicecandidate event to theRTCPeerConnection for transmission.

getLocalParameters()

Returns aRTCIceParameters object describing the ICE parameters established by a call to theRTCPeerConnection.setLocalDescription() method. Returnsnull if parameters have not yet been received.

getRemoteCandidates()

Returns an array ofRTCIceCandidate objects, one for each of the remote device's ICE candidates that have been received by the local end of theRTCPeerConnection and delivered to ICE by callingaddIceCandidate().

getRemoteParameters()

Returns aRTCIceParameters object containing the ICE parameters for the remote device, as set by a call toRTCPeerConnection.setRemoteDescription(). IfsetRemoteDescription() hasn't been called yet, the return value isnull.

getSelectedCandidatePair()

Returns aRTCIceCandidatePair object that identifies the two candidates—one for each end of the connection—that have been selected so far. It's possible that a better pair will be found and selected later; if you need to keep up with this, watch for theselectedcandidatepairchange event. If no candidate pair has been selected yet, the return value isnull.

Events

Listen to these events usingaddEventListener() or by assigning an event listener to theoneventname property of this interface.

gatheringstatechange

Sent to theRTCIceTransport object to indicate that the value of thegatheringState property has changed, indicating a change in this transport's ICE candidate negotiation process.Also available through theongatheringstatechange event handler property.

selectedcandidatepairchange

Sent to theRTCIceTransport when a new, better pair of candidates has been selected to describe the connectivity between the two peers. This occurs during negotiation or renegotiation, including after an ICE restart, which reuses the existingRTCIceTransport objects. The current candidate pair can be obtained usinggetSelectedCandidatePair().Also available using theonselectedcandidatepairchange event handler property.

statechange

Sent to theRTCIceTransport instance when the value of thestate property has changed, indicating that the ICE gathering process has changed state.Also available through theonstatechange event handler property.

Examples

tbd

Specifications

Specification
WebRTC: Real-Time Communication in Browsers
# dom-rtcicetransport

Browser compatibility

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp