RTCErrorEvent

The WebRTC API's RTCErrorEvent interface represents an error sent to a WebRTC object. It's based on the standard Event interface, but adds RTC-specific information describing the error, as shown below.

构造函数

RTCErrorEvent()
Creates and returns a new RTCErrorEvent 对象。

特性

In addition to the standard properties available on the Event interface, RTCErrorEvent also includes the following:

error 只读
An 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, Event .

描述

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.

规范

规范 状态 Comment
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCErrorEvent' in that specification.
候选推荐 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
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 ?

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知

另请参阅