API Docs for:
Show:

rtc.internal.ChannelCollection Class

Helper which handles DataChannel negotiation for RemotePeer

Methods

_update

() private

Matches remote and local descriptions and creates promises common DataChannels

get

(
  • name
)
Promise -> DataChannel

Get a promise to a DataChannel. Will resolve if DataChannel was offered and gets initiated. Might reject after remote and local description are processed.

Parameters:

  • name String

    The label of the channel to get

Returns:

Promise -> DataChannel:

Promise for the DataChannel

resolve

(
  • channel
)

Resolves promises waiting for the given DataChannel

Parameters:

  • channel DataChannel

    The new channel

setLocal

(
  • data
)

Set the local channel description.

Parameters:

  • data Object

    Object describing each offered DataChannel

setRemote

(
  • data
)

Set the remote channel description.

Parameters:

  • data Object

    Object describing each offered DataChannel

Events

data_channel_added

(
  • name
  • stream
)

A new data channel is available

Parameters:

  • name String

    Name of the channel

  • stream Promise -> rtc.Stream

    Promise of the channel