A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/closing_event below:

RTCDataChannel: closing event - Web APIs

RTCDataChannel: closing event

Limited availability

The closing event is sent to an RTCDataChannel just before the channel begins the process of shutting down its underlying data transport.

This event is not cancelable and does not bubble.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener("closing", (event) => { })

onclosing = (event) => { }
Event type

A generic Event.

Description

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.

Examples

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";
};
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3