@4players/odin-plugin-web 1.0.0-alpha.21 → 1.0.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/msgpack.d.ts +2 -0
- package/lib/common/msgpack.js +117 -0
- package/lib/plugin/config.d.ts +12 -0
- package/lib/plugin/config.js +22 -0
- package/lib/plugin/connectionPool.d.ts +17 -0
- package/lib/plugin/connectionPool.js +130 -0
- package/lib/plugin/deviceManager.d.ts +12 -0
- package/lib/plugin/deviceManager.js +120 -0
- package/lib/plugin/h3/mainConnection.d.ts +30 -0
- package/lib/plugin/h3/mainConnection.js +196 -0
- package/lib/plugin/index.d.ts +61 -18
- package/lib/plugin/index.js +405 -1
- package/lib/plugin/mainConnection.d.ts +30 -0
- package/lib/plugin/mainConnection.js +23 -0
- package/lib/plugin/mediaController.d.ts +66 -0
- package/lib/plugin/mediaController.js +215 -0
- package/lib/plugin/medias/audio-capture.d.ts +30 -0
- package/lib/plugin/medias/audio-capture.js +224 -0
- package/lib/plugin/medias/audio-playback.d.ts +13 -0
- package/lib/plugin/medias/audio-playback.js +40 -0
- package/lib/plugin/medias/video-capture.d.ts +15 -0
- package/lib/plugin/medias/video-capture.js +69 -0
- package/lib/plugin/medias/video-playback.d.ts +13 -0
- package/lib/plugin/medias/video-playback.js +20 -0
- package/lib/plugin/roomConnection.d.ts +40 -0
- package/lib/plugin/roomConnection.js +320 -0
- package/lib/plugin/rpcConnection.d.ts +57 -0
- package/lib/plugin/rpcConnection.js +281 -0
- package/lib/plugin/token.d.ts +13 -0
- package/lib/plugin/token.js +66 -0
- package/lib/plugin/webrtc/mainConnection.d.ts +52 -0
- package/lib/plugin/webrtc/mainConnection.js +455 -0
- package/lib/plugin/webrtc/websocket.d.ts +3 -0
- package/lib/plugin/webrtc/websocket.js +56 -0
- package/lib/wasm/index.d.ts +97 -0
- package/lib/worker/buffers.d.ts +42 -0
- package/lib/worker/buffers.js +79 -0
- package/lib/worker/common.d.ts +45 -0
- package/lib/worker/common.js +7 -0
- package/lib/worker/config.d.ts +8 -0
- package/lib/worker/config.js +11 -0
- package/lib/worker/index.d.ts +3 -0
- package/lib/worker/index.js +1 -0
- package/lib/worker/memory.d.ts +9 -0
- package/lib/worker/memory.js +29 -0
- package/lib/worker/messages.d.ts +14 -0
- package/lib/worker/messages.js +15 -0
- package/lib/worker/packet.d.ts +11 -0
- package/lib/worker/packet.js +59 -0
- package/lib/worker/shared/capture.d.ts +27 -0
- package/lib/worker/shared/capture.js +63 -0
- package/lib/worker/shared/index.d.ts +3 -0
- package/lib/worker/shared/index.js +147 -0
- package/lib/worker/shared/messages.d.ts +67 -0
- package/lib/worker/shared/messages.js +64 -0
- package/lib/worker/shared/playback.d.ts +20 -0
- package/lib/worker/shared/playback.js +78 -0
- package/lib/worker/unshared/capture.d.ts +27 -0
- package/lib/worker/unshared/capture.js +66 -0
- package/lib/worker/unshared/index.d.ts +3 -0
- package/lib/worker/unshared/index.js +170 -0
- package/lib/worker/unshared/messages.d.ts +81 -0
- package/lib/worker/unshared/messages.js +80 -0
- package/lib/worker/unshared/playback.d.ts +22 -0
- package/lib/worker/unshared/playback.js +83 -0
- package/package.json +9 -12
- package/lib/worker/shared.js +0 -1
- package/lib/worker/unshared.js +0 -1
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/* eslint-disable no-dupe-class-members */
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { failure, success, msgpackEncode, msgpackDecode, MessagePackRpcSchema, } from '@4players/odin-common';
|
|
12
|
+
import { getByteSize } from '../common/msgpack';
|
|
13
|
+
export class RpcConnection {
|
|
14
|
+
get closed() {
|
|
15
|
+
return this._Close.signal.aborted;
|
|
16
|
+
}
|
|
17
|
+
get closeSignal() {
|
|
18
|
+
return this._Close.signal;
|
|
19
|
+
}
|
|
20
|
+
constructor(stream) {
|
|
21
|
+
this.stream = stream;
|
|
22
|
+
this._SendQueue = [];
|
|
23
|
+
this._RecvQueue = [];
|
|
24
|
+
this._EventQueue = [];
|
|
25
|
+
this._Requests = new Map();
|
|
26
|
+
this._Close = new AbortController();
|
|
27
|
+
this._NextId = 1;
|
|
28
|
+
if (stream instanceof WebSocket) {
|
|
29
|
+
stream.addEventListener('open', this._OnWebSocketOpen.bind(this));
|
|
30
|
+
stream.addEventListener('close', this.close.bind(this));
|
|
31
|
+
stream.addEventListener('message', (event) => this._OnRpcMessage(event.data));
|
|
32
|
+
stream.binaryType = 'arraybuffer';
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
readRpcFromStream(stream.readable.getReader(), this._OnRpcMessage.bind(this))
|
|
36
|
+
.catch(console.error)
|
|
37
|
+
.finally(this.close.bind(this));
|
|
38
|
+
this._Writer = stream.writable.getWriter();
|
|
39
|
+
}
|
|
40
|
+
this._Close.signal.addEventListener('abort', this._Cleanup.bind(this), {
|
|
41
|
+
once: true,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
request(name, properties, timeout) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
if (this.closed) {
|
|
47
|
+
return Promise.resolve('closed');
|
|
48
|
+
}
|
|
49
|
+
const id = this._NextId;
|
|
50
|
+
const timeoutId = timeout === undefined
|
|
51
|
+
? undefined
|
|
52
|
+
: setTimeout(() => this._TimeoutRequest(id), timeout);
|
|
53
|
+
this._Send([0, id, name, properties]);
|
|
54
|
+
return new Promise((accept) => {
|
|
55
|
+
this._Requests.set(id, { accept, timeoutId });
|
|
56
|
+
this._NextId += 1;
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
notify(name, properties) {
|
|
61
|
+
if (!this.closed) {
|
|
62
|
+
this._Send([2, name, properties]);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
recv() {
|
|
66
|
+
if (this.closed) {
|
|
67
|
+
return Promise.resolve('closed');
|
|
68
|
+
}
|
|
69
|
+
const event = this._EventQueue.shift();
|
|
70
|
+
if (event !== undefined) {
|
|
71
|
+
return Promise.resolve(event);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
return new Promise((accept) => this._RecvQueue.push(accept));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
close() {
|
|
78
|
+
this._Close.abort();
|
|
79
|
+
}
|
|
80
|
+
_TimeoutRequest(requestId) {
|
|
81
|
+
const request = this._Requests.get(requestId);
|
|
82
|
+
if (request === undefined)
|
|
83
|
+
return;
|
|
84
|
+
this._Requests.delete(requestId);
|
|
85
|
+
clearTimeout(request.timeoutId);
|
|
86
|
+
request.accept('timeout');
|
|
87
|
+
}
|
|
88
|
+
_Send(message) {
|
|
89
|
+
const encoded = message instanceof Uint8Array
|
|
90
|
+
? message
|
|
91
|
+
: new Uint8Array(msgpackEncode(message));
|
|
92
|
+
if (this.stream instanceof WebSocket) {
|
|
93
|
+
this.stream.send(encoded);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
this._Writer.write(encoded);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
_OnWebSocketOpen(ev) {
|
|
100
|
+
for (const data of this._SendQueue) {
|
|
101
|
+
this._Send(data);
|
|
102
|
+
}
|
|
103
|
+
this._SendQueue.length = 0;
|
|
104
|
+
}
|
|
105
|
+
_OnRpcMessage(bytes) {
|
|
106
|
+
const rpc = parseRpc(bytes);
|
|
107
|
+
if (rpc.type !== 'Success') {
|
|
108
|
+
this.close();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
switch (rpc.value[0]) {
|
|
112
|
+
case 0:
|
|
113
|
+
this._Send([1, rpc.value[1], 'not supported', undefined]);
|
|
114
|
+
break;
|
|
115
|
+
case 1:
|
|
116
|
+
this._OnResponse(rpc.value[1], rpc.value[2], rpc.value[3]);
|
|
117
|
+
break;
|
|
118
|
+
case 2:
|
|
119
|
+
this._OnEvent(rpc.value[1], rpc.value[2]);
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
_OnResponse(id, error, result) {
|
|
124
|
+
const request = this._Requests.get(id);
|
|
125
|
+
if (request === undefined)
|
|
126
|
+
return;
|
|
127
|
+
clearTimeout(request.timeoutId);
|
|
128
|
+
request.accept(error === null ? success(result) : failure(error));
|
|
129
|
+
}
|
|
130
|
+
_OnEvent(name, properties) {
|
|
131
|
+
const receiver = this._RecvQueue.shift();
|
|
132
|
+
if (receiver !== undefined) {
|
|
133
|
+
receiver({ name, properties });
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
this._EventQueue.push({ name, properties });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
_Cleanup() {
|
|
140
|
+
var _a;
|
|
141
|
+
for (const request of this._Requests.values()) {
|
|
142
|
+
clearTimeout(request.timeoutId);
|
|
143
|
+
request.accept('closed');
|
|
144
|
+
}
|
|
145
|
+
this._Requests.clear();
|
|
146
|
+
for (const accept of this._RecvQueue) {
|
|
147
|
+
accept('closed');
|
|
148
|
+
}
|
|
149
|
+
this._RecvQueue.length = 0;
|
|
150
|
+
this._SendQueue.length = 0;
|
|
151
|
+
if (this.stream instanceof WebSocket) {
|
|
152
|
+
this.stream.close();
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
(_a = this._Writer) === null || _a === void 0 ? void 0 : _a.close().catch(() => {
|
|
156
|
+
/* drop silently */
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
export class TypedRpcConnection {
|
|
162
|
+
get closed() {
|
|
163
|
+
return this.rpcConnection.closed;
|
|
164
|
+
}
|
|
165
|
+
get closeSignal() {
|
|
166
|
+
return this.rpcConnection.closeSignal;
|
|
167
|
+
}
|
|
168
|
+
constructor(rpcConnection, _Commands, _Events) {
|
|
169
|
+
this.rpcConnection = rpcConnection;
|
|
170
|
+
this._Commands = _Commands;
|
|
171
|
+
this._Events = _Events;
|
|
172
|
+
}
|
|
173
|
+
request(name, properties, timeout) {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
properties = this._Commands[name].request.parse(properties);
|
|
176
|
+
const response = yield (timeout !== undefined
|
|
177
|
+
? this.rpcConnection.request(name, properties, timeout)
|
|
178
|
+
: this.rpcConnection.request(name, properties));
|
|
179
|
+
if (response === 'closed' ||
|
|
180
|
+
response === 'timeout' ||
|
|
181
|
+
response.type === 'Failure') {
|
|
182
|
+
return response;
|
|
183
|
+
}
|
|
184
|
+
const parsed = this._Commands[name].response.safeParse(response.value);
|
|
185
|
+
if (parsed.success) {
|
|
186
|
+
response.value = parsed.data;
|
|
187
|
+
return response;
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
return failure(`response schema failed validation: ${parsed.error}`);
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
notify(name, properties) {
|
|
195
|
+
properties = this._Commands[name].request.parse(properties);
|
|
196
|
+
this.rpcConnection.notify(name, properties);
|
|
197
|
+
}
|
|
198
|
+
recv() {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
const event = yield this.rpcConnection.recv();
|
|
201
|
+
if (event === 'closed')
|
|
202
|
+
return event;
|
|
203
|
+
const parsed = parseRpcMessage(this._Events, event);
|
|
204
|
+
if (parsed !== undefined) {
|
|
205
|
+
return parsed;
|
|
206
|
+
}
|
|
207
|
+
if (!isKnownRpcMessage(this._Events, event.name)) {
|
|
208
|
+
console.warn(`dropping unknown event ${event.name}`);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
console.error(`schema validation for ${event.name} failed; closing connection`);
|
|
212
|
+
this.rpcConnection.close();
|
|
213
|
+
}
|
|
214
|
+
return 'closed';
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
close() {
|
|
218
|
+
this.rpcConnection.close();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
export function parseRpc(buffer) {
|
|
222
|
+
try {
|
|
223
|
+
return success(MessagePackRpcSchema.parse(msgpackDecode(buffer)));
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
return failure(String(error));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
export function parseRpcMessage(events, rpc) {
|
|
230
|
+
if (!isKnownRpcMessage(events, rpc.name))
|
|
231
|
+
return undefined;
|
|
232
|
+
const parsed = events[rpc.name].safeParse(rpc.properties);
|
|
233
|
+
if (!parsed.success) {
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
name: rpc.name,
|
|
238
|
+
properties: parsed.data,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
export function isKnownRpcMessage(events, name) {
|
|
242
|
+
return name in events;
|
|
243
|
+
}
|
|
244
|
+
function readRpcFromStream(reader, onRpc) {
|
|
245
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
246
|
+
let buffer = new Uint8Array();
|
|
247
|
+
for (;;) {
|
|
248
|
+
let read;
|
|
249
|
+
try {
|
|
250
|
+
read = yield reader.read();
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
if (read.done)
|
|
256
|
+
break;
|
|
257
|
+
buffer = mergeBuffer(buffer, read.value);
|
|
258
|
+
let offset = 0;
|
|
259
|
+
for (let size;; offset += size) {
|
|
260
|
+
size = getByteSize(buffer, offset);
|
|
261
|
+
if (!size || offset + buffer.length < size)
|
|
262
|
+
break;
|
|
263
|
+
onRpc(buffer.subarray(offset, offset + size));
|
|
264
|
+
}
|
|
265
|
+
buffer = buffer.subarray(offset);
|
|
266
|
+
}
|
|
267
|
+
if (buffer.length > 0) {
|
|
268
|
+
console.warn('unprocessed bytes left in rpc stream', buffer);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
function mergeBuffer(a, b) {
|
|
273
|
+
if (a.length === 0)
|
|
274
|
+
return b;
|
|
275
|
+
if (b.length === 0)
|
|
276
|
+
return a;
|
|
277
|
+
const merged = new Uint8Array(a.length + b.length);
|
|
278
|
+
merged.set(a, 0);
|
|
279
|
+
merged.set(b, a.length);
|
|
280
|
+
return merged;
|
|
281
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TokenAudienceSchema, TokenClaims, Result, Infer } from '@4players/odin-common';
|
|
2
|
+
export declare class Token {
|
|
3
|
+
readonly text: string;
|
|
4
|
+
readonly claims: TokenClaims;
|
|
5
|
+
static parse(token: string): Result<Token>;
|
|
6
|
+
private readonly _Upstream;
|
|
7
|
+
protected constructor(text: string, claims: TokenClaims);
|
|
8
|
+
get timeLeft(): number;
|
|
9
|
+
get upstream(): Token | undefined;
|
|
10
|
+
get defaultRoomId(): string | undefined;
|
|
11
|
+
hasAudience(audience: Infer<typeof TokenAudienceSchema>): boolean;
|
|
12
|
+
toString(): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { TokenClaimsSchema, failure, fromBase64Url, success, } from '@4players/odin-common';
|
|
2
|
+
export class Token {
|
|
3
|
+
static parse(token) {
|
|
4
|
+
const segments = token.split('.');
|
|
5
|
+
if (segments.length !== 3)
|
|
6
|
+
return failure('expected three segments');
|
|
7
|
+
const body = fromBase64Url(segments[1]);
|
|
8
|
+
if (body.type === 'Failure') {
|
|
9
|
+
return failure(`invalid token; ${body.reason}`);
|
|
10
|
+
}
|
|
11
|
+
let json;
|
|
12
|
+
try {
|
|
13
|
+
json = JSON.parse(body.value);
|
|
14
|
+
}
|
|
15
|
+
catch (reason) {
|
|
16
|
+
return failure(`invalid token; ${reason}`);
|
|
17
|
+
}
|
|
18
|
+
const parsed = TokenClaimsSchema.safeParse(json);
|
|
19
|
+
if (parsed.success === false) {
|
|
20
|
+
return failure(`invalid token; ${parsed.error}`);
|
|
21
|
+
}
|
|
22
|
+
return success(new Token(token, parsed.data));
|
|
23
|
+
}
|
|
24
|
+
constructor(text, claims) {
|
|
25
|
+
this.text = text;
|
|
26
|
+
this.claims = claims;
|
|
27
|
+
if (claims.ups !== undefined) {
|
|
28
|
+
const upstream = Token.parse(claims.ups);
|
|
29
|
+
if (upstream.type === 'Success') {
|
|
30
|
+
this._Upstream = upstream.value;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
console.error(`upstream in token can not be parsed; ${upstream.reason}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
get timeLeft() {
|
|
38
|
+
if (this.claims.exp === undefined)
|
|
39
|
+
return Infinity;
|
|
40
|
+
return this.claims.exp * 1000 - Date.now();
|
|
41
|
+
}
|
|
42
|
+
get upstream() {
|
|
43
|
+
return this._Upstream;
|
|
44
|
+
}
|
|
45
|
+
get defaultRoomId() {
|
|
46
|
+
if (Array.isArray(this.claims.rid)) {
|
|
47
|
+
return this.claims.rid.length === 1 ? this.claims.rid[0] : undefined;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return this.claims.rid;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
hasAudience(audience) {
|
|
54
|
+
if (this.claims.aud === undefined)
|
|
55
|
+
return true;
|
|
56
|
+
if (Array.isArray(this.claims.aud)) {
|
|
57
|
+
return this.claims.aud.includes(audience);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return this.claims.aud === audience;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
toString() {
|
|
64
|
+
return this.text;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { MainCommands, MainNotifications, Result, Backend } from '@4players/odin-common';
|
|
2
|
+
import { type MainConnection, type DatagramHandler, ConnectionStatus } from '../mainConnection';
|
|
3
|
+
import { Token } from '../token';
|
|
4
|
+
import { RpcConnection, TypedRpcConnection } from '../rpcConnection';
|
|
5
|
+
export declare class WebRtcMainConnection implements MainConnection {
|
|
6
|
+
readonly id: number;
|
|
7
|
+
readonly address: string;
|
|
8
|
+
readonly url: URL;
|
|
9
|
+
readonly onDatagram: DatagramHandler;
|
|
10
|
+
readonly connection: TypedRpcConnection<MainCommands, MainNotifications>;
|
|
11
|
+
readonly webRtc: RTCPeerConnection;
|
|
12
|
+
static create(id: number, address: string, onDatagram: DatagramHandler, signal: AbortSignal): Promise<Result<MainConnection>>;
|
|
13
|
+
private readonly _AudioChannel;
|
|
14
|
+
private readonly _PeerIdMap;
|
|
15
|
+
private _PeriodicHealthCheck;
|
|
16
|
+
private _WebRtcIceTimeout;
|
|
17
|
+
private _WebRtcTimeout;
|
|
18
|
+
private _ClosePromise;
|
|
19
|
+
private _LocalVideos;
|
|
20
|
+
private _RemoteVideos;
|
|
21
|
+
private _Negotiation;
|
|
22
|
+
private _ResolveOffer?;
|
|
23
|
+
private _awaitingRemoteTracks;
|
|
24
|
+
get transport(): Backend.Transport;
|
|
25
|
+
get closePromise(): Promise<"closed">;
|
|
26
|
+
get closeSignal(): AbortSignal;
|
|
27
|
+
get closed(): boolean;
|
|
28
|
+
get status(): ConnectionStatus;
|
|
29
|
+
waitForConnected(): Promise<void>;
|
|
30
|
+
private constructor();
|
|
31
|
+
close(): void;
|
|
32
|
+
joinRoom(token: Token, roomId: string, userData: Uint8Array, position: [number, number, number]): Promise<Result<RpcConnection> | 'closed'>;
|
|
33
|
+
getReconnectToken(peerId: number): Promise<Result<Token>>;
|
|
34
|
+
sendDatagram(datagram: Uint8Array): void;
|
|
35
|
+
healthCheck(): Promise<boolean>;
|
|
36
|
+
private _Request;
|
|
37
|
+
private _readWebRtcUpdate;
|
|
38
|
+
private _SendOffer;
|
|
39
|
+
private _OnWebRtcStatusChanged;
|
|
40
|
+
private _OnWebRtcUpdate;
|
|
41
|
+
private _UpdateRemoteSdp;
|
|
42
|
+
private _AddIceCandidate;
|
|
43
|
+
private _OnIceCandidate;
|
|
44
|
+
private ensureTransceivers;
|
|
45
|
+
startLocalVideo(mediaId: number, track: MediaStreamTrack): Promise<void>;
|
|
46
|
+
stopLocalVideo(mediaId: number): void;
|
|
47
|
+
startRemoteVideo(mediaId: number): Promise<MediaStreamTrack>;
|
|
48
|
+
stopRemoteVideo(mediaId: number): void;
|
|
49
|
+
private onTrack;
|
|
50
|
+
requestNegotiation(waitForAnswer: boolean): void;
|
|
51
|
+
private _CleanUp;
|
|
52
|
+
}
|