WebRTCService
Extends:
service/Service~Service → WebRTCService
Service class responsible to establish connections between peers via
RTCDataChannel
.
Constructor Summary
Public Constructor | ||
public |
constructor(id: number, iceServers: RTCIceServer) |
Method Summary
Public Methods | ||
public |
connectOverSignaling(ws: type, key: type): type |
|
public |
connectOverWebChannel(wc: WebChannel, id: number): Promise<RTCDataChannel, string> Establishes an |
|
public |
listenFromSignaling(ws: WebSocket, onChannel: function(channel: RTCDataChannel)) |
|
public |
|
Public Constructors
public constructor(id: number, iceServers: RTCIceServer) source
Params:
Name | Type | Attribute | Description |
id | number | Service identifier |
|
iceServers | RTCIceServer | WebRTC configuration object |
Public Methods
public connectOverSignaling(ws: type, key: type): type source
Params:
Name | Type | Attribute | Description |
ws | type | ||
key | type | Description |
Return:
type | Description |
public connectOverWebChannel(wc: WebChannel, id: number): Promise<RTCDataChannel, string> source
Establishes an RTCDataChannel
with a peer identified by id
trough WebChannel
.
Params:
Name | Type | Attribute | Description |
wc | WebChannel | ||
id | number |
public listenFromSignaling(ws: WebSocket, onChannel: function(channel: RTCDataChannel)) source
Params:
Name | Type | Attribute | Description |
ws | WebSocket | ||
onChannel | function(channel: RTCDataChannel) |