closing
event is sent to an
RTCDataChannel
just before the channel begins the process of shutting down its underlying data transport.
| 冒泡 | No |
|---|---|
| 可取消 | No |
| 接口 |
事件
|
| 事件处理程序特性 |
RTCDataChannel.onclosing
|
While the
closing
event is sent to the channel just before beginning to close the channel's data transport, the
close
event is sent once the closing process is complete.
This example updates a connection status interface when the
closing
event arrives.
First, an example using
addEventListener()
:
dataChannel.addEventListener("closing", ev => {
myConnectionStatus.icon = closingIcon;
myConnectionStatus.text = "Connection closing";
});
You can also set the
onclosing
event handler property directly:
pc.onclosing = ev => {
myConnectionStatus.icon = closingIcon;
myConnectionStatus.text = "Connection closing";
};
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCDataChannel: closing event' in that specification. |
候选推荐 |
No compatibility data found. Please contribute data for "api.RTCDataChannel.closing_event" (depth: 1) to the MDN 兼容性数据存储库 .