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.
RTCIceTransport
interface inherits properties from its parent,
EventTarget
. It also offers the following properties:
component
只读
RTCIceTransport
enumerated type:
"RTP"
or
"RTSP"
.
gatheringState
只读
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"
,或
"complete"
.
role
只读
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
只读
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.
Also includes methods from
EventTarget
, the parent interface.
getLocalCandidates()
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()
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()
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()
RTCIceParameters
object containing the ICE parameters for the remote device, as set by a call to
RTCPeerConnection.setRemoteDescription()
。若
setRemoteDescription()
hasn't been called yet, the return value is
null
.
getSelectedCandidatePair()
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
.
监听这些事件使用
addEventListener()
或通过把事件监听器赋值给
on
eventname
特性为此接口。
gatheringstatechange
RTCIceTransport
object to indicate that the value of the
gatheringState
property has changed, indicating a change in this transport's ICE candidate negotiation process.
ongatheringstatechange
event handler property.
selectedcandidatepairchange
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()
.
onselectedcandidatepairchange
event handler property.
statechange
RTCIceTransport
instance when the value of the
state
property has changed, indicating that the ICE gathering process has changed state.
onstatechange
event handler property.
tbd
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCIceTransport' in that specification. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
RTCIceTransport
|
Chrome 不支持 No | Edge 不支持 15 — 79 | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 11 | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 11 | Samsung Internet Android 不支持 No |
component
|
Chrome 不支持 No | Edge 不支持 15 — 79 | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
gatheringState
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 11 | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 11 | Samsung Internet Android 不支持 No |
gatheringstatechange
event
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
getLocalCandidates
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
getLocalParameters
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
getRemoteCandidates
|
Chrome 不支持 No | Edge 不支持 15 — 79 | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
getRemoteParameters
|
Chrome 不支持 No | Edge 不支持 15 — 79 | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
getSelectedCandidatePair
|
Chrome 不支持 No |
Edge
不支持
15 — 79
Alternate Name
|
Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
ongatheringstatechange
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
onselectedcandidatepairchange
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
onstatechange
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
role
|
Chrome 不支持 No | Edge 不支持 15 — 79 | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
selectedcandidatepairchange
event
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
state
|
Chrome 不支持 No | Edge 不支持 15 — 79 | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 11 | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 11 | Samsung Internet Android 不支持 No |
statechange
event
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
完整支持
不支持
使用非标名称。
RTCIceTransport
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent