onstatechange
event handler for the
RTCIceTransport
interface is a property which specifies a function to serve as the
EventHandler
为
statechange
event that is fired whenever the transport's
state
改变。
RTCIceTransport.onstatechange = stateChangeHandler;
Set this property to reference a function you provide that is called by the WebRTC layer when the
RTCIceTransport
对象的
state
改变。
The event handler receives as its sole input an
事件
object describing the
statechange
event which occurred. To determine the new state, examine the value of
state
.
This snippet establishes a handler for the
statechange
event that looks to see if the transport has entered the
"failed"
state, which indicates that the connection has failed with no chance of being automatically restored.
var iceTransport = pc.getSenders()[0].transport.iceTransport;
iceTransport.onstatechange = function(event) {
if (iceTransport.state == "failed") {
handleFailure(pc);
}
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCIceTransport.onstatechange' in that specification. |
候选推荐 | 最初的规范。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 |
不支持
statechange
event and its type,
事件
.
RTCIceTransport
:
ongatheringstatechange
and
onselectedcandidatepairchange
RTCIceTransport
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent