The WebRTC API's
RTCErrorEvent
interface represents an error sent to a WebRTC object. It's based on the standard
事件
interface, but adds RTC-specific information describing the error, as shown below.
RTCErrorEvent()
RTCErrorEvent
对象。
In addition to the standard properties available on the
事件
interface,
RTCErrorEvent
also includes the following:
error
只读
RTCError
object specifying the error which occurred; this object includes the type of error that occurred, information about where the error occurred (such as which line number in the
SDP
or what
SCTP
cause code was at issue).
No additional methods are provided beyond any found on the parent interface,
事件
.
There are other data types used for error events in WebRTC, as needed for errors with special information sharing requirements. The most common of these is probably
RTCPeerConnectionIceErrorEvent
, used by the
icecandidateerror
event, which signals an error that has occurred while gathering ICE candidates during connection negotiation.
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCErrorEvent' in that specification. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
RTCErrorEvent
|
Chrome ? | Edge ? | Firefox ? | IE No | Opera ? | Safari ? | WebView Android ? | Chrome Android ? | Firefox Android ? | Opera Android ? | Safari iOS 6 | Samsung Internet Android ? |
error
|
Chrome ? | Edge ? | Firefox ? | IE No | Opera ? | Safari ? | WebView Android ? | Chrome Android ? | Firefox Android ? | Opera Android ? | Safari iOS 6 | Samsung Internet Android ? |
完整支持
不支持
兼容性未知
RTCError
error
event occurs on the following interfaces:
RTCDataChannel
and
RTCDtlsTransport
RTCPeerConnectionIceErrorEvent
RTCPeerConnection
RTCSessionDescription
RTCIceCandidate
RTCPeerConnectionIceEvent
RTCPeerConnectionIceErrorEvent
RTCCertificate
RTCRtpSender
RTCRtpReceiver
RTCRtpTransceiver
RTCDtlsTransport
RTCIceTransport
RTCTrackEvent
RTCSctpTransport
RTCDataChannel
RTCDataChannelEvent
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCStatsReport
RTCStatsEvent
RTCErrorEvent