createDataChannel method

RTCDataChannel createDataChannel(
  1. String label, [
  2. RTCDataChannelInit dataChannelDict
])

The createDataChannel() method of the RTCPeerConnection interface creates a new channel linked with the remote peer, over which any kind of data may be transmitted. This can be useful for back-channel content, such as images, file transfer, text chat, game update packets, and so forth.

If the new data channel is the first one added to the connection, renegotiation is started by delivering a RTCPeerConnection.negotiationneeded_event event.

Implementation

external RTCDataChannel createDataChannel(
  String label, [
  RTCDataChannelInit dataChannelDict,
]);