RTCDataChannel

@native @JSType

The RTCDataChannel interface represents a bi-directional data channel between two peers of a connection.

class Object
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

def bufferedAmount: Double

Returns an unsigned long containing the amount of bytes that have been queued for sending: that is the amount of data requested to be transmitted via RTCDataChannel.send() that has not been sent yet. Note that if the channel state, as given by RTCDataChannel.readyState is "closed", the buffering continues.

Returns an unsigned long containing the amount of bytes that have been queued for sending: that is the amount of data requested to be transmitted via RTCDataChannel.send() that has not been sent yet. Note that if the channel state, as given by RTCDataChannel.readyState is "closed", the buffering continues.

def close(): Unit

Returns an enum of the type RTCDataChannelState representing the state of the underlying data connection.

Returns an enum of the type RTCDataChannelState representing the state of the underlying data connection.

def send(data: String | Blob | ArrayBuffer | ArrayBufferView): Unit

Sends the data in parameter over the channel. The data can be a DOMString, a Blob, an ArrayBuffer or an ArrayBufferView.

Sends the data in parameter over the channel. The data can be a DOMString, a Blob, an ArrayBuffer or an ArrayBufferView.

Inherited methods

def addEventListener[T <: Event](`type`: String, listener: Function1[T, _], options: EventListenerOptions): Unit

The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).

The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).

This implementation accepts a settings object of type EventListenerOptions.

Inherited from:
EventTarget
def addEventListener[T <: Event](`type`: String, listener: Function1[T, _], useCapture: Boolean): Unit

The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).

The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).

Inherited from:
EventTarget
def dispatchEvent(evt: Event): Boolean

Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().

Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().

Inherited from:
EventTarget
def hasOwnProperty(v: String): Boolean
Inherited from:
Object
def isPrototypeOf(v: Object): Boolean
Inherited from:
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from:
Object
def removeEventListener[T <: Event](`type`: String, listener: Function1[T, _], options: EventListenerOptions): Unit

Removes the event listener previously registered with EventTarget.addEventListener.

Removes the event listener previously registered with EventTarget.addEventListener.

This implementation accepts a settings object of type EventListenerOptions.

Inherited from:
EventTarget
def removeEventListener[T <: Event](`type`: String, listener: Function1[T, _], useCapture: Boolean): Unit

Removes the event listener previously registered with EventTarget.addEventListener.

Removes the event listener previously registered with EventTarget.addEventListener.

Inherited from:
EventTarget
def toLocaleString(): String
Inherited from:
Object
def valueOf(): Any
Inherited from:
Object

Concrete fields

var binaryType: String

Returns a DOMString indicating the type of binary data transmitted by the connection. This should be either "blob" if Blob objects are being used or "arraybuffer" if ArrayBuffer objects are being used. Initially it is set to "blob".

Returns a DOMString indicating the type of binary data transmitted by the connection. This should be either "blob" if Blob objects are being used or "arraybuffer" if ArrayBuffer objects are being used. Initially it is set to "blob".

It controls the type of the MessageEvent.data property passed in the parameter of message targetting this RTCDataChannel.

val id: Double

Returns an unsigned short being a unique id for the channel. It is set at the creation of the RTCDataChannel object.

Returns an unsigned short being a unique id for the channel. It is set at the creation of the RTCDataChannel object.

val label: String

Returns a DOMString containing a name describing the data channel. There is no constraint of uniqueness about it.

Returns a DOMString containing a name describing the data channel. There is no constraint of uniqueness about it.

val maxPacketLifeTime: Double
val maxRetransmits: Double
val negotiated: Boolean
var onclose: Function1[Event, Any]

Is the event handler called when the close event is received. Such an event is sent when the underlying data transport has been closed.

Is the event handler called when the close event is received. Such an event is sent when the underlying data transport has been closed.

var onerror: Function1[Event, Any]
var onmessage: Function1[MessageEvent, Any]

Is the event handler called when the message event is received. Such an event is sent when a message is available on the data connection.

Is the event handler called when the message event is received. Such an event is sent when a message is available on the data connection.

var onopen: Function1[Event, Any]
val ordered: Boolean

The read-only property RTCDataChannel.ordered returns a Boolean indicating if the order of delivery of the messages is guaranteed or not.

The read-only property RTCDataChannel.ordered returns a Boolean indicating if the order of delivery of the messages is guaranteed or not.

val protocol: String

Returns a DOMString containing the name of the subprotocol in use. If none, it returns "".

Returns a DOMString containing the name of the subprotocol in use. If none, it returns "".