WebRTCConnector

channels.webrtc.WebRTCConnector
See theWebRTCConnector companion object
class WebRTCConnector(configuration: RTCConfiguration)

First listen to lifecycle and optionally iceCandidates. Then create a channel directly on peer connection, which will trigger the connection initiation process. Somehow transfer the local session description to a remote peer, and updateRemoteDescription there. Accepting a remote description will update the local description, which then needs to be transferred back to the original peer and smartUpdateLocalDescription there should complete the connection.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def iceCandidates: Async[Any, RTCIceCandidate]

Use peerConnection.addIceCandidate to apply on remote. Once an ICE candidate exists it is also automatically included in the local description, so this is not necessary.

Use peerConnection.addIceCandidate to apply on remote. Once an ICE candidate exists it is also automatically included in the local description, so this is not necessary.

Attributes

def lifecycle: Async[Any, ConnectorOverview]

This is triggered by smartUpdateLocalDescription, which in turn is automatically triggered when adding a channel. For reasons that are unclear to me, a data channel MUST be created before looking at the lifecycle, otherwise ICE gathering does not happen

This is triggered by smartUpdateLocalDescription, which in turn is automatically triggered when adding a channel. For reasons that are unclear to me, a data channel MUST be created before looking at the lifecycle, otherwise ICE gathering does not happen

Attributes

Mostly to wrap the session descriptions, but having the rest is also convenient

Mostly to wrap the session descriptions, but having the rest is also convenient

Attributes

def restartIce(): Unit

this exists, but unclear how it could be used to restart the connection

this exists, but unclear how it could be used to restart the connection

Attributes

This just generates a local description that automatically figures out if it should be an offer or an answer based on the current state.

This just generates a local description that automatically figures out if it should be an offer or an answer based on the current state.

Attributes

Might yell at you if called multiple times with incompatible sessions. Better just throw away the whole peer connection on retry.

Might yell at you if called multiple times with incompatible sessions. Better just throw away the whole peer connection on retry.

Attributes

Concrete fields

val peerConnection: RTCPeerConnection