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/RTCDataChannelEvent below:

RTCDataChannelEvent - Web APIs | MDN

RTCDataChannelEvent

Baseline Widely available

The RTCDataChannelEvent interface represents an event related to a specific RTCDataChannel.

Event RTCDataChannelEvent Constructor
RTCDataChannelEvent()

Creates a new RTCDataChannelEvent.

Instance properties

Also inherits properties from Event.

channel Read only

Returns the RTCDataChannel associated with the event.

Examples

In this example, the datachannel event handler is set up to save the data channel reference and set up handlers for the events which need to be monitored. The channel property provides the RTCDataChannel representing the connection to the other peer.

pc.ondatachannel = (event) => {
  inboundDataChannel = event.channel;
  inboundDataChannel.onmessage = handleIncomingMessage;
  inboundDataChannel.onopen = handleChannelOpen;
  inboundDataChannel.onclose = handleChannelClose;
};

See A simple RTCDataChannel sample for another, more complete, example of how to use data channels.

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