RTCIceTransport - Web APIs 编辑

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.

Properties

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

component Read only
The ICE component being used by the transport. The value is one of the strings from the RTCIceTransport enumerated type: "RTP" or "RTSP".
gatheringState Read only
A DOMString indicating which gathering state the ICE agent is currently in. The value is one of those included in the RTCIceGathererState enumerated type: "new", "gathering", or "complete".
role Read only
Returns a DOMString whose value is one of the members of the RTCIceRole enumerated type: "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.
state Read only
A DOMString indicating what the current state of the ICE agent is. The value of state 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. See the RTCIceTransportState enumerated type for a complete list of states.

Methods

Also includes methods from EventTarget, the parent interface.

getLocalCandidates()
Returns an array of RTCIceCandidate 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 an icecandidate event to the RTCPeerConnection for transmission.
getLocalParameters()
Returns a RTCIceParameters object describing the ICE parameters established by a call to the RTCPeerConnection.setLocalDescription() method. Returns null if parameters have not yet been received.
getRemoteCandidates()
Returns an array of RTCIceCandidate objects, one for each of the remote device's ICE candidates that have been received by the local end of the RTCPeerConnection and delivered to ICE by calling addIceCandidate().
getRemoteParameters()
Returns a RTCIceParameters object containing the ICE parameters for the remote device, as set by a call to RTCPeerConnection.setRemoteDescription(). If setRemoteDescription() hasn't been called yet, the return value is null.
getSelectedCandidatePair()
Returns a RTCIceCandidatePair 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 the selectedcandidatepairchange event. If no candidate pair has been selected yet, the return value is null.

Events

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.

gatheringstatechange
Sent to the RTCIceTransport object to indicate that the value of the gatheringState property has changed, indicating a change in this transport's ICE candidate negotiation process.
Also available through the ongatheringstatechange event handler property.
selectedcandidatepairchange
Sent to the RTCIceTransport 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 existing RTCIceTransport objects. The current candidate pair can be obtained using getSelectedCandidatePair().
Also available using the onselectedcandidatepairchange event handler property.
statechange
Sent to the RTCIceTransport instance when the value of the state property has changed, indicating that the ICE gathering process has changed state.
Also available through the onstatechange event handler property.

Examples

tbd

Specifications

SpecificationStatusComment
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCIceTransport' in that specification.
Candidate RecommendationInitial definition.

Browser compatibility

BCD tables only load in the browser

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:90 次

字数:9237

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文