@ikonai/sdk 1.0.11 → 1.0.12
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/assets/{audio-capture-worker-D0tD-mzj.js → audio-capture-worker-Ca53cEkv.js} +127 -121
- package/assets/{audio-playback-worker-CM2aCt54.js → audio-playback-worker-D0LDYB5W.js} +93 -83
- package/assets/{video-capture-worker-DZZ0ggvo.js → video-capture-worker-Odc_mLEl.js} +145 -141
- package/assets/{video-playback-worker-C7sQMgD-.js → video-playback-worker-OwSrJCnC.js} +220 -221
- package/index.js +1112 -1095
- package/media/ikon-audio-capture.d.ts +2 -0
- package/media/ikon-video-capture.d.ts +6 -4
- package/media/ikon-video-playback.d.ts +0 -1
- package/package.json +1 -1
- package/worker/video-capture-worker.d.ts +1 -0
- package/worker/video-playback-worker.d.ts +2 -0
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
const
|
|
1
|
+
const j = {
|
|
2
2
|
Compressed: 8
|
|
3
3
|
};
|
|
4
|
-
function
|
|
5
|
-
const r =
|
|
4
|
+
function Q(t) {
|
|
5
|
+
const r = P(t), e = new DataView(r.buffer, r.byteOffset, r.byteLength);
|
|
6
6
|
if (r.length < 27)
|
|
7
7
|
throw new Error("Protocol payload too short");
|
|
8
|
-
const n = e.getUint32(0, !0), s = e.getUint32(4, !0), E = e.getUint32(8, !0), _ = e.getUint32(12, !0), i = e.getUint32(16, !0), N = e.getUint32(20, !0), o = e.getUint8(24),
|
|
8
|
+
const n = e.getUint32(0, !0), s = e.getUint32(4, !0), E = e.getUint32(8, !0), _ = e.getUint32(12, !0), i = e.getUint32(16, !0), N = e.getUint32(20, !0), o = e.getUint8(24), g = e.getUint8(25), q = e.getUint8(26);
|
|
9
9
|
if (27 + N * 4 > r.length)
|
|
10
10
|
throw new Error("Protocol header exceeds payload length");
|
|
11
|
-
const
|
|
12
|
-
let
|
|
13
|
-
for (let
|
|
14
|
-
|
|
11
|
+
const d = [];
|
|
12
|
+
let H = 27;
|
|
13
|
+
for (let K = 0; K < N; K++)
|
|
14
|
+
d.push(e.getUint32(H, !0)), H += 4;
|
|
15
15
|
return {
|
|
16
16
|
length: n,
|
|
17
17
|
opcode: s,
|
|
18
18
|
senderId: E,
|
|
19
19
|
trackId: _,
|
|
20
20
|
sequenceId: i,
|
|
21
|
-
targetIds:
|
|
21
|
+
targetIds: d,
|
|
22
22
|
payloadVersion: o,
|
|
23
|
-
payloadType:
|
|
24
|
-
flags:
|
|
23
|
+
payloadType: g,
|
|
24
|
+
flags: q
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
async function x(t, r, e) {
|
|
28
|
-
const n =
|
|
28
|
+
const n = P(t), s = Q(n);
|
|
29
29
|
if (r !== void 0 && s.opcode !== r)
|
|
30
30
|
throw new Error(`Unexpected opcode ${s.opcode}`);
|
|
31
31
|
if (s.payloadType !== 8)
|
|
32
32
|
throw new Error(`Unexpected payload type ${s.payloadType}`);
|
|
33
33
|
const E = 27 + s.targetIds.length * 4;
|
|
34
34
|
let _ = n.subarray(E, s.length);
|
|
35
|
-
return (s.flags &
|
|
35
|
+
return (s.flags & j.Compressed) !== 0 && (_ = await J(_)), _;
|
|
36
36
|
}
|
|
37
|
-
async function
|
|
37
|
+
async function J(t) {
|
|
38
38
|
if (typeof DecompressionStream > "u")
|
|
39
39
|
throw new Error("DecompressionStream not supported");
|
|
40
40
|
const r = new DecompressionStream("gzip"), e = r.writable.getWriter(), n = new Uint8Array(t);
|
|
@@ -42,9 +42,9 @@ async function p(t) {
|
|
|
42
42
|
const s = r.readable.getReader(), E = [];
|
|
43
43
|
let _ = 0;
|
|
44
44
|
for (; ; ) {
|
|
45
|
-
const { done: o, value:
|
|
45
|
+
const { done: o, value: g } = await s.read();
|
|
46
46
|
if (o) break;
|
|
47
|
-
E.push(
|
|
47
|
+
E.push(g), _ += g.length;
|
|
48
48
|
}
|
|
49
49
|
const i = new Uint8Array(_);
|
|
50
50
|
let N = 0;
|
|
@@ -52,36 +52,36 @@ async function p(t) {
|
|
|
52
52
|
i.set(E[o], N), N += E[o].length;
|
|
53
53
|
return i;
|
|
54
54
|
}
|
|
55
|
-
var
|
|
56
|
-
const
|
|
55
|
+
var l = /* @__PURE__ */ ((t) => (t[t.Null = 1] = "Null", t[t.Bool = 2] = "Bool", t[t.Int32 = 3] = "Int32", t[t.Int64 = 4] = "Int64", t[t.UInt32 = 5] = "UInt32", t[t.UInt64 = 6] = "UInt64", t[t.Float32 = 7] = "Float32", t[t.Float64 = 8] = "Float64", t[t.Array = 9] = "Array", t[t.Dict = 10] = "Dict", t[t.Object = 11] = "Object", t[t.String = 12] = "String", t[t.Binary = 13] = "Binary", t[t.Guid = 14] = "Guid", t))(l || {});
|
|
56
|
+
const Z = 161, p = 162;
|
|
57
57
|
new TextEncoder();
|
|
58
|
-
const
|
|
59
|
-
class
|
|
58
|
+
const tt = new TextDecoder("utf-8", { fatal: !0 });
|
|
59
|
+
class O {
|
|
60
60
|
constructor(r, e, n) {
|
|
61
61
|
this.buffer = r, this.version = e, this.offset = n, this.end = r.length - 1;
|
|
62
62
|
}
|
|
63
63
|
offset;
|
|
64
64
|
end;
|
|
65
65
|
static create(r) {
|
|
66
|
-
const e =
|
|
66
|
+
const e = P(r);
|
|
67
67
|
if (e.length < 2)
|
|
68
68
|
throw new Error("Teleport payload too short");
|
|
69
|
-
if (e[0] !==
|
|
69
|
+
if (e[0] !== Z || e[e.length - 1] !== p)
|
|
70
70
|
throw new Error("Teleport object missing markers");
|
|
71
71
|
const n = { offset: 1 }, s = A(e, n, "InvalidLength");
|
|
72
|
-
return new
|
|
72
|
+
return new O(e, s, n.offset);
|
|
73
73
|
}
|
|
74
74
|
next() {
|
|
75
75
|
if (this.offset >= this.end)
|
|
76
76
|
return null;
|
|
77
77
|
if (this.offset + 5 > this.buffer.length)
|
|
78
78
|
throw new Error("Teleport object truncated");
|
|
79
|
-
const r =
|
|
79
|
+
const r = st(this.buffer, this.offset);
|
|
80
80
|
this.offset += 4;
|
|
81
81
|
const e = this.buffer[this.offset++], n = e >> 4 & 15;
|
|
82
82
|
if ((e & 15) !== 0)
|
|
83
83
|
throw new Error("Teleport field flags must be zero");
|
|
84
|
-
const s =
|
|
84
|
+
const s = S(n);
|
|
85
85
|
let E;
|
|
86
86
|
if (s >= 0)
|
|
87
87
|
I(this.buffer, this.offset, s), E = this.buffer.subarray(this.offset, this.offset + s), this.offset += s;
|
|
@@ -89,7 +89,7 @@ class P {
|
|
|
89
89
|
const _ = { offset: this.offset }, i = A(this.buffer, _, "InvalidLength");
|
|
90
90
|
I(this.buffer, _.offset, i), E = this.buffer.subarray(_.offset, _.offset + i), this.offset = _.offset + i;
|
|
91
91
|
}
|
|
92
|
-
return new
|
|
92
|
+
return new rt(r, n, E);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
class f {
|
|
@@ -154,7 +154,7 @@ class f {
|
|
|
154
154
|
return this.ensureType(
|
|
155
155
|
12
|
|
156
156
|
/* String */
|
|
157
|
-
),
|
|
157
|
+
), tt.decode(this.payload);
|
|
158
158
|
}
|
|
159
159
|
asGuid() {
|
|
160
160
|
return this.ensureType(
|
|
@@ -166,26 +166,26 @@ class f {
|
|
|
166
166
|
return this.ensureType(
|
|
167
167
|
11
|
|
168
168
|
/* Object */
|
|
169
|
-
),
|
|
169
|
+
), O.create(this.payload);
|
|
170
170
|
}
|
|
171
171
|
asArray() {
|
|
172
172
|
return this.ensureType(
|
|
173
173
|
9
|
|
174
174
|
/* Array */
|
|
175
|
-
),
|
|
175
|
+
), M.create(this.payload);
|
|
176
176
|
}
|
|
177
177
|
asDictionary() {
|
|
178
178
|
return this.ensureType(
|
|
179
179
|
10
|
|
180
180
|
/* Dict */
|
|
181
|
-
),
|
|
181
|
+
), G.create(this.payload);
|
|
182
182
|
}
|
|
183
183
|
ensureType(r) {
|
|
184
184
|
if (this.type !== r)
|
|
185
|
-
throw new Error(`Teleport value has type ${
|
|
185
|
+
throw new Error(`Teleport value has type ${l[this.type]}, expected ${l[r]}`);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
class
|
|
188
|
+
class rt extends f {
|
|
189
189
|
constructor(r, e, n) {
|
|
190
190
|
super(e, n), this.fieldId = r;
|
|
191
191
|
}
|
|
@@ -193,7 +193,7 @@ class nt extends f {
|
|
|
193
193
|
return this.type === 1;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
class
|
|
196
|
+
class M {
|
|
197
197
|
payload;
|
|
198
198
|
elementType;
|
|
199
199
|
count;
|
|
@@ -209,7 +209,7 @@ class V {
|
|
|
209
209
|
this.count = A(r, n, "ArrayMalformed"), this.offset = n.offset;
|
|
210
210
|
}
|
|
211
211
|
static create(r) {
|
|
212
|
-
return new
|
|
212
|
+
return new M(P(r));
|
|
213
213
|
}
|
|
214
214
|
next() {
|
|
215
215
|
if (this.index >= this.count) {
|
|
@@ -230,43 +230,43 @@ class V {
|
|
|
230
230
|
case 4:
|
|
231
231
|
case 6:
|
|
232
232
|
case 14: {
|
|
233
|
-
const r =
|
|
233
|
+
const r = S(this.elementType);
|
|
234
234
|
I(this.payload, this.offset, r);
|
|
235
235
|
const e = this.payload.subarray(this.offset, this.offset + r);
|
|
236
|
-
return this.offset += r, new
|
|
236
|
+
return this.offset += r, new c(this.elementType, e);
|
|
237
237
|
}
|
|
238
238
|
case 12:
|
|
239
239
|
case 13: {
|
|
240
240
|
const r = { offset: this.offset }, e = A(this.payload, r, "ArrayMalformed");
|
|
241
241
|
I(this.payload, r.offset, e);
|
|
242
242
|
const n = this.payload.subarray(r.offset, r.offset + e);
|
|
243
|
-
return this.offset = r.offset + e, new
|
|
243
|
+
return this.offset = r.offset + e, new c(this.elementType, n);
|
|
244
244
|
}
|
|
245
245
|
case 11: {
|
|
246
246
|
const r = { offset: this.offset }, e = A(this.payload, r, "ArrayMalformed");
|
|
247
247
|
I(this.payload, r.offset, e);
|
|
248
248
|
const n = this.payload.subarray(r.offset, r.offset + e);
|
|
249
|
-
return this.offset = r.offset + e, new
|
|
249
|
+
return this.offset = r.offset + e, new c(11, n);
|
|
250
250
|
}
|
|
251
251
|
case 9: {
|
|
252
|
-
const r =
|
|
253
|
-
return this.offset += r, new
|
|
252
|
+
const r = B(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
253
|
+
return this.offset += r, new c(9, e);
|
|
254
254
|
}
|
|
255
255
|
case 10: {
|
|
256
|
-
const r =
|
|
257
|
-
return this.offset += r, new
|
|
256
|
+
const r = b(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
257
|
+
return this.offset += r, new c(10, e);
|
|
258
258
|
}
|
|
259
259
|
default:
|
|
260
|
-
throw new Error(`Unsupported array element type ${
|
|
260
|
+
throw new Error(`Unsupported array element type ${l[this.elementType]}`);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
class
|
|
264
|
+
class c extends f {
|
|
265
265
|
constructor(r, e) {
|
|
266
266
|
super(r, e);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
class
|
|
269
|
+
class G {
|
|
270
270
|
payload;
|
|
271
271
|
keyType;
|
|
272
272
|
valueType;
|
|
@@ -278,12 +278,12 @@ class M {
|
|
|
278
278
|
throw new Error("Dictionary payload too short");
|
|
279
279
|
if (this.keyType = r[0] >> 4 & 15, this.valueType = r[1] >> 4 & 15, (r[0] & 15) !== 0 || (r[1] & 15) !== 0)
|
|
280
280
|
throw new Error("Dictionary key/value flags must be zero");
|
|
281
|
-
|
|
281
|
+
Y(this.keyType);
|
|
282
282
|
const e = { offset: 2 };
|
|
283
283
|
this.count = A(r, e, "DictMalformed"), this.offset = e.offset;
|
|
284
284
|
}
|
|
285
285
|
static create(r) {
|
|
286
|
-
return new
|
|
286
|
+
return new G(P(r));
|
|
287
287
|
}
|
|
288
288
|
next() {
|
|
289
289
|
if (this.index >= this.count) {
|
|
@@ -292,10 +292,10 @@ class M {
|
|
|
292
292
|
return null;
|
|
293
293
|
}
|
|
294
294
|
const r = this.readKey(), e = this.readValue();
|
|
295
|
-
return this.index++, new
|
|
295
|
+
return this.index++, new et(r, e);
|
|
296
296
|
}
|
|
297
297
|
readKey() {
|
|
298
|
-
const r =
|
|
298
|
+
const r = S(this.keyType);
|
|
299
299
|
if (r >= 0) {
|
|
300
300
|
I(this.payload, this.offset, r);
|
|
301
301
|
const e = this.payload.subarray(this.offset, this.offset + r);
|
|
@@ -325,11 +325,11 @@ class M {
|
|
|
325
325
|
return this.offset = r.offset + e, new f(11, n);
|
|
326
326
|
}
|
|
327
327
|
case 9: {
|
|
328
|
-
const r =
|
|
328
|
+
const r = B(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
329
329
|
return this.offset += r, new f(9, e);
|
|
330
330
|
}
|
|
331
331
|
case 10: {
|
|
332
|
-
const r =
|
|
332
|
+
const r = b(this.payload, this.offset), e = this.payload.subarray(this.offset, this.offset + r);
|
|
333
333
|
return this.offset += r, new f(10, e);
|
|
334
334
|
}
|
|
335
335
|
case 3:
|
|
@@ -341,17 +341,17 @@ class M {
|
|
|
341
341
|
case 6:
|
|
342
342
|
case 14:
|
|
343
343
|
case 1: {
|
|
344
|
-
const r =
|
|
344
|
+
const r = S(this.valueType);
|
|
345
345
|
I(this.payload, this.offset, r);
|
|
346
346
|
const e = this.payload.subarray(this.offset, this.offset + r);
|
|
347
347
|
return this.offset += r, new f(this.valueType, e);
|
|
348
348
|
}
|
|
349
349
|
default:
|
|
350
|
-
throw new Error(`Unsupported dictionary value type ${
|
|
350
|
+
throw new Error(`Unsupported dictionary value type ${l[this.valueType]}`);
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
class
|
|
354
|
+
class et {
|
|
355
355
|
constructor(r, e) {
|
|
356
356
|
this.key = r, this.value = e;
|
|
357
357
|
}
|
|
@@ -395,8 +395,8 @@ class a {
|
|
|
395
395
|
a.toHex(a.readUInt32LE(r, 0), 8),
|
|
396
396
|
a.toHex(a.readUInt16LE(r, 4), 4),
|
|
397
397
|
a.toHex(a.readUInt16LE(r, 6), 4),
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
v(r.subarray(8, 10)),
|
|
399
|
+
v(r.subarray(10, 16))
|
|
400
400
|
].join("-");
|
|
401
401
|
}
|
|
402
402
|
asBytes() {
|
|
@@ -433,7 +433,7 @@ function A(t, r, e) {
|
|
|
433
433
|
for (; r.offset < t.length; ) {
|
|
434
434
|
const _ = t[r.offset++];
|
|
435
435
|
if (E++, n |= (_ & 127) << s, (_ & 128) === 0) {
|
|
436
|
-
if (E !==
|
|
436
|
+
if (E !== nt(n))
|
|
437
437
|
throw new Error("Teleport VarUInt is not canonical");
|
|
438
438
|
return n >>> 0;
|
|
439
439
|
}
|
|
@@ -442,10 +442,10 @@ function A(t, r, e) {
|
|
|
442
442
|
}
|
|
443
443
|
throw new Error(e);
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function nt(t) {
|
|
446
446
|
return t < 128 ? 1 : t < 16384 ? 2 : t < 2097152 ? 3 : t < 268435456 ? 4 : 5;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function S(t) {
|
|
449
449
|
switch (t) {
|
|
450
450
|
case 3:
|
|
451
451
|
case 5:
|
|
@@ -465,7 +465,7 @@ function l(t) {
|
|
|
465
465
|
return -1;
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function Y(t) {
|
|
469
469
|
if (t === 9 || t === 11 || t === 10 || t === 1)
|
|
470
470
|
throw new Error("Dictionary keys must be primitive Teleport types");
|
|
471
471
|
}
|
|
@@ -473,16 +473,16 @@ function I(t, r, e) {
|
|
|
473
473
|
if (r < 0 || e < 0 || r + e > t.length)
|
|
474
474
|
throw new Error("Teleport payload exceeds bounds");
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function st(t, r) {
|
|
477
477
|
return (t[r] | t[r + 1] << 8 | t[r + 2] << 16 | t[r + 3] << 24) >>> 0;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function B(t, r) {
|
|
480
480
|
if (r >= t.length)
|
|
481
481
|
throw new Error("Array payload exceeds bounds");
|
|
482
482
|
const e = t[r], n = e >> 4 & 15;
|
|
483
483
|
if ((e & 15) !== 0)
|
|
484
484
|
throw new Error("Array flags must be zero");
|
|
485
|
-
const s = { offset: r + 1 }, E = A(t, s, "ArrayMalformed"), _ =
|
|
485
|
+
const s = { offset: r + 1 }, E = A(t, s, "ArrayMalformed"), _ = S(n);
|
|
486
486
|
if (_ >= 0) {
|
|
487
487
|
const N = _ * E;
|
|
488
488
|
return I(t, s.offset, N), s.offset + N - r;
|
|
@@ -492,13 +492,13 @@ function G(t, r) {
|
|
|
492
492
|
i = F(n, t, i, "ArrayMalformed");
|
|
493
493
|
return i - r;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function b(t, r) {
|
|
496
496
|
if (r + 2 > t.length)
|
|
497
497
|
throw new Error("Dictionary payload too short");
|
|
498
498
|
const e = t[r] >> 4 & 15, n = t[r + 1] >> 4 & 15;
|
|
499
499
|
if ((t[r] & 15) !== 0 || (t[r + 1] & 15) !== 0)
|
|
500
500
|
throw new Error("Dictionary key/value flags must be zero");
|
|
501
|
-
|
|
501
|
+
Y(e);
|
|
502
502
|
const s = { offset: r + 2 }, E = A(t, s, "DictMalformed");
|
|
503
503
|
let _ = s.offset;
|
|
504
504
|
for (let i = 0; i < E; i++)
|
|
@@ -506,7 +506,7 @@ function B(t, r) {
|
|
|
506
506
|
return _ - r;
|
|
507
507
|
}
|
|
508
508
|
function F(t, r, e, n) {
|
|
509
|
-
const s =
|
|
509
|
+
const s = S(t);
|
|
510
510
|
if (s >= 0)
|
|
511
511
|
return I(r, e, s), e + s;
|
|
512
512
|
switch (t) {
|
|
@@ -520,107 +520,112 @@ function F(t, r, e, n) {
|
|
|
520
520
|
return I(r, E.offset, _), E.offset + _;
|
|
521
521
|
}
|
|
522
522
|
case 9:
|
|
523
|
-
return e + G(r, e);
|
|
524
|
-
case 10:
|
|
525
523
|
return e + B(r, e);
|
|
524
|
+
case 10:
|
|
525
|
+
return e + b(r, e);
|
|
526
526
|
default:
|
|
527
|
-
throw new Error(`Unsupported Teleport type ${
|
|
527
|
+
throw new Error(`Unsupported Teleport type ${l[t]}`);
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function v(t) {
|
|
531
531
|
return Array.from(t).map((r) => r.toString(16).padStart(2, "0")).join("");
|
|
532
532
|
}
|
|
533
|
-
function
|
|
533
|
+
function P(t) {
|
|
534
534
|
return t instanceof Uint8Array ? t : new Uint8Array(t);
|
|
535
535
|
}
|
|
536
|
-
var h = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(h || {}), L = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(L || {});
|
|
537
|
-
const
|
|
538
|
-
function
|
|
536
|
+
var R = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.H264 = 1] = "H264", t[t.Vp8 = 2] = "Vp8", t[t.Vp9 = 3] = "Vp9", t[t.Av1 = 4] = "Av1", t))(R || {}), L = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.CONSTANT_GROUP_BITS = 15] = "CONSTANT_GROUP_BITS", t[t.CONSTANT_GROUP_OFFSET = 16] = "CONSTANT_GROUP_OFFSET", t[t.GROUP_CORE = 65536] = "GROUP_CORE", t[t.CORE_AUTH_RESPONSE = 65537] = "CORE_AUTH_RESPONSE", t[t.CORE_AUTH_TICKET = 65538] = "CORE_AUTH_TICKET", t[t.CORE_GLOBAL_STATE = 65539] = "CORE_GLOBAL_STATE", t[t.CORE_ON_SERVER_STATUS_PING = 65540] = "CORE_ON_SERVER_STATUS_PING", t[t.CORE_ON_USER_JOINED = 65541] = "CORE_ON_USER_JOINED", t[t.CORE_ON_USER_LEFT = 65542] = "CORE_ON_USER_LEFT", t[t.CORE_ON_CLIENT_JOINED = 65543] = "CORE_ON_CLIENT_JOINED", t[t.CORE_ON_CLIENT_LEFT = 65544] = "CORE_ON_CLIENT_LEFT", t[t.CORE_ON_SERVER_STARTED = 65545] = "CORE_ON_SERVER_STARTED", t[t.CORE_ON_SERVER_STOPPED = 65546] = "CORE_ON_SERVER_STOPPED", t[t.CORE_ON_SERVER_STOPPING = 65547] = "CORE_ON_SERVER_STOPPING", t[t.CORE_ON_CLIENT_READY = 65548] = "CORE_ON_CLIENT_READY", t[t.CORE_CLIENT_READY = 65549] = "CORE_CLIENT_READY", t[t.CORE_SERVER_INIT = 65550] = "CORE_SERVER_INIT", t[t.CORE_ON_PLUGIN_RELOADED = 65551] = "CORE_ON_PLUGIN_RELOADED", t[t.CORE_SERVER_START = 65552] = "CORE_SERVER_START", t[t.CORE_SERVER_STOP = 65553] = "CORE_SERVER_STOP", t[t.CORE_ON_HOSTED_SERVER_EXIT = 65554] = "CORE_ON_HOSTED_SERVER_EXIT", t[t.CORE_DYNAMIC_CONFIG = 65555] = "CORE_DYNAMIC_CONFIG", t[t.CORE_PROXY_RPC_AUTH_TICKET = 65556] = "CORE_PROXY_RPC_AUTH_TICKET", t[t.CORE_SERVER_INIT2 = 65557] = "CORE_SERVER_INIT2", t[t.GROUP_KEEPALIVE = 131072] = "GROUP_KEEPALIVE", t[t.KEEPALIVE_REQUEST = 131073] = "KEEPALIVE_REQUEST", t[t.KEEPALIVE_RESPONSE = 131074] = "KEEPALIVE_RESPONSE", t[t.GROUP_EVENTS = 262144] = "GROUP_EVENTS", t[t.EVENTS_PROFILE_UPDATE = 262145] = "EVENTS_PROFILE_UPDATE", t[t.EVENTS_CHANNEL_COMPLETE = 262146] = "EVENTS_CHANNEL_COMPLETE", t[t.EVENTS_SPEECH_PLAYBACK_COMPLETE = 262147] = "EVENTS_SPEECH_PLAYBACK_COMPLETE", t[t.GROUP_ANALYTICS = 524288] = "GROUP_ANALYTICS", t[t.ANALYTICS_LOGS = 524289] = "ANALYTICS_LOGS", t[t.ANALYTICS_EVENTS = 524290] = "ANALYTICS_EVENTS", t[t.ANALYTICS_USAGES = 524291] = "ANALYTICS_USAGES", t[t.ANALYTICS_USAGE = 524292] = "ANALYTICS_USAGE", t[t.ANALYTICS_SPECIAL_LOG = 524293] = "ANALYTICS_SPECIAL_LOG", t[t.ANALYTICS_PROCESSING_UPDATE = 524294] = "ANALYTICS_PROCESSING_UPDATE", t[t.ANALYTICS_REACTIVE_PROCESSING_UPDATE = 524295] = "ANALYTICS_REACTIVE_PROCESSING_UPDATE", t[t.ANALYTICS_IKON_PROXY_SERVER_STATS = 524296] = "ANALYTICS_IKON_PROXY_SERVER_STATS", t[t.GROUP_ACTIONS = 1048576] = "GROUP_ACTIONS", t[t.ACTION_CALL = 1048577] = "ACTION_CALL", t[t.ACTION_ACTIVE = 1048578] = "ACTION_ACTIVE", t[t.ACTION_TEXT_OUTPUT = 1048579] = "ACTION_TEXT_OUTPUT", t[t.ACTION_TEXT_OUTPUT_DELTA = 1048580] = "ACTION_TEXT_OUTPUT_DELTA", t[t.ACTION_TEXT_OUTPUT_DELTA_FULL = 1048581] = "ACTION_TEXT_OUTPUT_DELTA_FULL", t[t.ACTION_SET_STATE = 1048582] = "ACTION_SET_STATE", t[t.ACTION_TAP = 1048583] = "ACTION_TAP", t[t.ACTION_PAN = 1048584] = "ACTION_PAN", t[t.ACTION_ZOOM = 1048585] = "ACTION_ZOOM", t[t.ACTION_FILE_UPLOAD_BEGIN = 1048586] = "ACTION_FILE_UPLOAD_BEGIN", t[t.ACTION_FILE_UPLOAD_DATA = 1048587] = "ACTION_FILE_UPLOAD_DATA", t[t.ACTION_FILE_UPLOAD_ACK = 1048588] = "ACTION_FILE_UPLOAD_ACK", t[t.ACTION_FILE_UPLOAD_END = 1048589] = "ACTION_FILE_UPLOAD_END", t[t.ACTION_FILE_UPLOAD_RESULT = 1048590] = "ACTION_FILE_UPLOAD_RESULT", t[t.ACTION_OPEN_CHANNEL = 1048591] = "ACTION_OPEN_CHANNEL", t[t.ACTION_OPEN_EXTERNAL_URL = 1048592] = "ACTION_OPEN_EXTERNAL_URL", t[t.ACTION_UI_OPEN_VIEW = 1048593] = "ACTION_UI_OPEN_VIEW", t[t.ACTION_UI_CLOSE_VIEW = 1048594] = "ACTION_UI_CLOSE_VIEW", t[t.ACTION_UI_BLOCKING_BEGIN = 1048595] = "ACTION_UI_BLOCKING_BEGIN", t[t.ACTION_UI_BLOCKING_END = 1048596] = "ACTION_UI_BLOCKING_END", t[t.ACTION_UI_UPDATE_TEXT_DELTA = 1048597] = "ACTION_UI_UPDATE_TEXT_DELTA", t[t.ACTION_UI_DELETE_CONTAINER = 1048598] = "ACTION_UI_DELETE_CONTAINER", t[t.ACTION_UPDATE_GFX_SHADER = 1048599] = "ACTION_UPDATE_GFX_SHADER", t[t.ACTION_FUNCTION_REGISTER = 1048600] = "ACTION_FUNCTION_REGISTER", t[t.ACTION_FUNCTION_CALL = 1048601] = "ACTION_FUNCTION_CALL", t[t.ACTION_FUNCTION_RESULT = 1048602] = "ACTION_FUNCTION_RESULT", t[t.ACTION_GENERATE_ANSWER = 1048603] = "ACTION_GENERATE_ANSWER", t[t.ACTION_REGENERATE_ANSWER = 1048604] = "ACTION_REGENERATE_ANSWER", t[t.ACTION_CLEAR_CHAT_MESSAGE_HISTORY = 1048605] = "ACTION_CLEAR_CHAT_MESSAGE_HISTORY", t[t.ACTION_CLEAR_STATE = 1048606] = "ACTION_CLEAR_STATE", t[t.ACTION_RELOAD_CHANNELS = 1048607] = "ACTION_RELOAD_CHANNELS", t[t.ACTION_RELOAD_PROFILE = 1048608] = "ACTION_RELOAD_PROFILE", t[t.ACTION_CLASSIFICATION_RESULT = 1048609] = "ACTION_CLASSIFICATION_RESULT", t[t.ACTION_AUDIO_STOP = 1048610] = "ACTION_AUDIO_STOP", t[t.ACTION_CALL_TEXT = 1048611] = "ACTION_CALL_TEXT", t[t.ACTION_RELOAD_APPLICATION = 1048612] = "ACTION_RELOAD_APPLICATION", t[t.ACTION_CANCEL_GENERATION = 1048613] = "ACTION_CANCEL_GENERATION", t[t.ACTION_UI_SET_CONTAINER_STABLE = 1048614] = "ACTION_UI_SET_CONTAINER_STABLE", t[t.ACTION_SPEECH_RECOGNIZED = 1048615] = "ACTION_SPEECH_RECOGNIZED", t[t.ACTION_CALL_RESULT = 1048616] = "ACTION_CALL_RESULT", t[t.ACTION_RELOAD_PROVIDER = 1048617] = "ACTION_RELOAD_PROVIDER", t[t.ACTION_DOWNLOAD = 1048618] = "ACTION_DOWNLOAD", t[t.ACTION_SCROLL_TO_CONTAINER = 1048619] = "ACTION_SCROLL_TO_CONTAINER", t[t.ACTION_UI_CLEAR_STREAM = 1048620] = "ACTION_UI_CLEAR_STREAM", t[t.ACTION_PLAY_SOUND = 1048621] = "ACTION_PLAY_SOUND", t[t.ACTION_ENTER_FULLSCREEN = 1048622] = "ACTION_ENTER_FULLSCREEN", t[t.ACTION_STOP_SOUND = 1048623] = "ACTION_STOP_SOUND", t[t.ACTION_START_RECORDING = 1048624] = "ACTION_START_RECORDING", t[t.ACTION_STOP_RECORDING = 1048625] = "ACTION_STOP_RECORDING", t[t.ACTION_OPTIMISTIC_CLIENT_CALLS = 1048626] = "ACTION_OPTIMISTIC_CLIENT_CALLS", t[t.ACTION_FUNCTION_ENUMERATION_ITEM = 1048627] = "ACTION_FUNCTION_ENUMERATION_ITEM", t[t.ACTION_FUNCTION_ENUMERATION_END = 1048628] = "ACTION_FUNCTION_ENUMERATION_END", t[t.ACTION_FUNCTION_CANCEL = 1048629] = "ACTION_FUNCTION_CANCEL", t[t.ACTION_FUNCTION_DISPOSE = 1048630] = "ACTION_FUNCTION_DISPOSE", t[t.ACTION_FUNCTION_ERROR = 1048631] = "ACTION_FUNCTION_ERROR", t[t.ACTION_FUNCTION_ACK = 1048632] = "ACTION_FUNCTION_ACK", t[t.ACTION_FUNCTION_AWAITING_APPROVAL = 1048633] = "ACTION_FUNCTION_AWAITING_APPROVAL", t[t.ACTION_FUNCTION_APPROVAL_REQUIRED = 1048634] = "ACTION_FUNCTION_APPROVAL_REQUIRED", t[t.ACTION_FUNCTION_APPROVAL_RESPONSE = 1048635] = "ACTION_FUNCTION_APPROVAL_RESPONSE", t[t.UI_UPDATE_ACK = 1048636] = "UI_UPDATE_ACK", t[t.ACTION_CALL2 = 1048637] = "ACTION_CALL2", t[t.ACTION_FUNCTION_REGISTER_BATCH = 1048638] = "ACTION_FUNCTION_REGISTER_BATCH", t[t.ACTION_TRIGGER_GIT_PULL = 1048639] = "ACTION_TRIGGER_GIT_PULL", t[t.ACTION_FILE_UPLOAD_CALLBACK = 1048640] = "ACTION_FILE_UPLOAD_CALLBACK", t[t.ACTION_CUSTOM_USER_MESSAGE = 1048641] = "ACTION_CUSTOM_USER_MESSAGE", t[t.GROUP_UI = 2097152] = "GROUP_UI", t[t.UI_STREAM_BEGIN = 2097153] = "UI_STREAM_BEGIN", t[t.UI_STREAM_END = 2097154] = "UI_STREAM_END", t[t.UI_CONTAINER_BEGIN = 2097155] = "UI_CONTAINER_BEGIN", t[t.UI_CONTAINER_END = 2097156] = "UI_CONTAINER_END", t[t.UI_SECTION_BEGIN = 2097157] = "UI_SECTION_BEGIN", t[t.UI_SECTION_END = 2097158] = "UI_SECTION_END", t[t.UI_LIST_BEGIN = 2097159] = "UI_LIST_BEGIN", t[t.UI_LIST_ITEM = 2097160] = "UI_LIST_ITEM", t[t.UI_LIST_END = 2097161] = "UI_LIST_END", t[t.UI_TEXT = 2097162] = "UI_TEXT", t[t.UI_HEADER = 2097163] = "UI_HEADER", t[t.UI_SEPARATOR = 2097164] = "UI_SEPARATOR", t[t.UI_BUTTON = 2097165] = "UI_BUTTON", t[t.UI_ICON_BUTTON = 2097166] = "UI_ICON_BUTTON", t[t.UI_IMAGE = 2097167] = "UI_IMAGE", t[t.UI_FILE = 2097168] = "UI_FILE", t[t.UI_BADGE = 2097169] = "UI_BADGE", t[t.UI_CONTENT_LINK = 2097170] = "UI_CONTENT_LINK", t[t.UI_MAP = 2097171] = "UI_MAP", t[t.UI_VEGA_CHART = 2097172] = "UI_VEGA_CHART", t[t.UI_ICON = 2097173] = "UI_ICON", t[t.UI_FILE_UPLOAD_SECTION_BEGIN = 2097174] = "UI_FILE_UPLOAD_SECTION_BEGIN", t[t.UI_FILE_UPLOAD_SECTION_END = 2097175] = "UI_FILE_UPLOAD_SECTION_END", t[t.UI_MATERIAL_SYMBOL = 2097176] = "UI_MATERIAL_SYMBOL", t[t.UI_BUTTON_BEGIN = 2097177] = "UI_BUTTON_BEGIN", t[t.UI_BUTTON_END = 2097178] = "UI_BUTTON_END", t[t.UI_CONTAINER_DELETE = 2097179] = "UI_CONTAINER_DELETE", t[t.UI_INPUT_TEXT = 2097180] = "UI_INPUT_TEXT", t[t.UI_PROGRESS_BAR = 2097181] = "UI_PROGRESS_BAR", t[t.UI_UPDATE_BEGIN = 2097182] = "UI_UPDATE_BEGIN", t[t.UI_UPDATE_END = 2097183] = "UI_UPDATE_END", t[t.UI_AUTOCOMPLETE = 2097184] = "UI_AUTOCOMPLETE", t[t.UI_CHECKBOX = 2097185] = "UI_CHECKBOX", t[t.UI_QS = 2097186] = "UI_QS", t[t.UI_ELEMENT = 2097187] = "UI_ELEMENT", t[t.UI_STYLES = 2097188] = "UI_STYLES", t[t.UI_SVG = 2097189] = "UI_SVG", t[t.UI_UPDATE = 2097190] = "UI_UPDATE", t[t.UI_INIT = 2097191] = "UI_INIT", t[t.UI_STYLES_BATCH = 2097192] = "UI_STYLES_BATCH", t[t.UI_STYLES_DELETE = 2097193] = "UI_STYLES_DELETE", t[t.GROUP_COMMON = 4128768] = "GROUP_COMMON", t[t.GROUP_AUDIO = 4194304] = "GROUP_AUDIO", t[t.AUDIO_STREAM_BEGIN = 4194305] = "AUDIO_STREAM_BEGIN", t[t.AUDIO_STREAM_END = 4194306] = "AUDIO_STREAM_END", t[t.AUDIO_FRAME = 4194307] = "AUDIO_FRAME", t[t.AUDIO_FRAME_VOLUME = 4194308] = "AUDIO_FRAME_VOLUME", t[t.AUDIO_FRAME2 = 4194309] = "AUDIO_FRAME2", t[t.GROUP_VIDEO = 8388608] = "GROUP_VIDEO", t[t.VIDEO_STREAM_BEGIN = 8388609] = "VIDEO_STREAM_BEGIN", t[t.VIDEO_STREAM_END = 8388610] = "VIDEO_STREAM_END", t[t.VIDEO_FRAME = 8388611] = "VIDEO_FRAME", t[t.VIDEO_REQUEST_IDR_FRAME = 8388612] = "VIDEO_REQUEST_IDR_FRAME", t[t.VIDEO_INVALIDATE_FRAME = 8388613] = "VIDEO_INVALIDATE_FRAME", t[t.GROUP_TRACKING = 16777216] = "GROUP_TRACKING", t[t.TRACKING_STREAM_BEGIN = 16777217] = "TRACKING_STREAM_BEGIN", t[t.TRACKING_STREAM_END = 16777218] = "TRACKING_STREAM_END", t[t.TRACKING_FRAME = 16777219] = "TRACKING_FRAME", t[t.GROUP_SCENE = 33554432] = "GROUP_SCENE", t[t.SCENE_MESH = 33554433] = "SCENE_MESH", t[t.SCENE_ARRAY = 33554434] = "SCENE_ARRAY", t[t.GROUP_ALL = 67043328] = "GROUP_ALL", t[t.CONSTANT_GROUP_MASK = 2147418112] = "CONSTANT_GROUP_MASK", t))(L || {});
|
|
537
|
+
const Et = 8388609, _t = 161083277, it = 164808083, at = 1368629611, It = 2745379226, At = 2950031986, Tt = 3282782683, Nt = 3284746250, ft = 4065070594;
|
|
538
|
+
function ot(t) {
|
|
539
539
|
const r = {};
|
|
540
|
-
return
|
|
540
|
+
return k(r), r;
|
|
541
541
|
}
|
|
542
|
-
function
|
|
543
|
-
return t.Description = "", t.
|
|
542
|
+
function k(t) {
|
|
543
|
+
return t.StreamId = "", t.Description = "", t.SourceType = "", t.Codec = R.H264, t.CodecDetails = "", t.Width = 0, t.Height = 0, t.Framerate = 30, t;
|
|
544
|
+
}
|
|
545
|
+
function Ct(t, r) {
|
|
546
|
+
const e = O.create(t);
|
|
547
|
+
return ut(e, r);
|
|
544
548
|
}
|
|
545
549
|
function ut(t, r) {
|
|
546
|
-
const e =
|
|
547
|
-
return ht(e,
|
|
550
|
+
const e = r ?? ot();
|
|
551
|
+
return k(e), ht(t, e), e;
|
|
548
552
|
}
|
|
549
553
|
function ht(t, r) {
|
|
550
|
-
const e = r ?? Ct();
|
|
551
|
-
return Y(e), Rt(t, e), e;
|
|
552
|
-
}
|
|
553
|
-
function Rt(t, r) {
|
|
554
554
|
let e;
|
|
555
555
|
for (; (e = t.next()) !== null; )
|
|
556
556
|
switch (e.fieldId) {
|
|
557
|
+
case _t: {
|
|
558
|
+
if (e.isNull) throw new Error();
|
|
559
|
+
r.StreamId = e.asString();
|
|
560
|
+
break;
|
|
561
|
+
}
|
|
562
|
+
case it: {
|
|
563
|
+
if (e.isNull) throw new Error();
|
|
564
|
+
r.Framerate = e.asFloat64();
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
557
567
|
case at: {
|
|
558
568
|
if (e.isNull) throw new Error();
|
|
559
|
-
r.
|
|
569
|
+
r.Description = e.asString();
|
|
560
570
|
break;
|
|
561
571
|
}
|
|
562
572
|
case It: {
|
|
563
573
|
if (e.isNull) throw new Error();
|
|
564
|
-
r.
|
|
574
|
+
r.CodecDetails = e.asString();
|
|
565
575
|
break;
|
|
566
576
|
}
|
|
567
577
|
case At: {
|
|
568
578
|
if (e.isNull) throw new Error();
|
|
569
|
-
r.
|
|
579
|
+
r.Height = e.asInt32();
|
|
570
580
|
break;
|
|
571
581
|
}
|
|
572
582
|
case Tt: {
|
|
573
583
|
if (e.isNull) throw new Error();
|
|
574
|
-
r.
|
|
584
|
+
r.SourceType = e.asString();
|
|
575
585
|
break;
|
|
576
586
|
}
|
|
577
587
|
case Nt: {
|
|
578
|
-
if (e.isNull) throw new Error();
|
|
579
|
-
r.Height = e.asInt32();
|
|
580
|
-
break;
|
|
581
|
-
}
|
|
582
|
-
case ft: {
|
|
583
588
|
if (e.isNull) throw new Error();
|
|
584
589
|
r.Codec = e.asInt32();
|
|
585
590
|
break;
|
|
586
591
|
}
|
|
587
|
-
case
|
|
592
|
+
case ft: {
|
|
588
593
|
if (e.isNull) throw new Error();
|
|
589
594
|
r.Width = e.asInt32();
|
|
590
595
|
break;
|
|
591
596
|
}
|
|
592
597
|
}
|
|
593
598
|
}
|
|
594
|
-
async function
|
|
595
|
-
const e = await x(t,
|
|
596
|
-
return
|
|
599
|
+
async function Rt(t, r) {
|
|
600
|
+
const e = await x(t, Et);
|
|
601
|
+
return Ct(e, r);
|
|
597
602
|
}
|
|
598
|
-
const
|
|
599
|
-
function
|
|
603
|
+
const Ut = 8388611, lt = 271275304, St = 2541432218, Dt = 2986785889, ct = 3105403172, Lt = 3456383222;
|
|
604
|
+
function yt(t) {
|
|
600
605
|
const r = {};
|
|
601
606
|
return X(r), r;
|
|
602
607
|
}
|
|
603
608
|
function X(t) {
|
|
604
609
|
return t.Data = new Uint8Array(0), t.FrameNumber = 0, t.IsKey = !1, t.TimestampInUs = 0n, t.DurationInUs = 0, t;
|
|
605
610
|
}
|
|
606
|
-
function
|
|
607
|
-
const e =
|
|
611
|
+
function wt(t, r) {
|
|
612
|
+
const e = O.create(t);
|
|
608
613
|
return Ot(e, r);
|
|
609
614
|
}
|
|
610
615
|
function Ot(t, r) {
|
|
611
|
-
const e = r ??
|
|
612
|
-
return X(e),
|
|
616
|
+
const e = r ?? yt();
|
|
617
|
+
return X(e), Pt(t, e), e;
|
|
613
618
|
}
|
|
614
|
-
function
|
|
619
|
+
function Pt(t, r) {
|
|
615
620
|
let e;
|
|
616
621
|
for (; (e = t.next()) !== null; )
|
|
617
622
|
switch (e.fieldId) {
|
|
618
|
-
case
|
|
623
|
+
case lt: {
|
|
619
624
|
if (e.isNull) throw new Error();
|
|
620
625
|
r.TimestampInUs = e.asUInt64();
|
|
621
626
|
break;
|
|
622
627
|
}
|
|
623
|
-
case
|
|
628
|
+
case St: {
|
|
624
629
|
if (e.isNull) throw new Error();
|
|
625
630
|
r.DurationInUs = e.asUInt32();
|
|
626
631
|
break;
|
|
@@ -630,42 +635,39 @@ function gt(t, r) {
|
|
|
630
635
|
r.Data = e.asBinary();
|
|
631
636
|
break;
|
|
632
637
|
}
|
|
633
|
-
case
|
|
638
|
+
case ct: {
|
|
634
639
|
if (e.isNull) throw new Error();
|
|
635
640
|
r.IsKey = e.asBool();
|
|
636
641
|
break;
|
|
637
642
|
}
|
|
638
|
-
case
|
|
643
|
+
case Lt: {
|
|
639
644
|
if (e.isNull) throw new Error();
|
|
640
645
|
r.FrameNumber = e.asInt32();
|
|
641
646
|
break;
|
|
642
647
|
}
|
|
643
648
|
}
|
|
644
649
|
}
|
|
645
|
-
async function
|
|
646
|
-
const e = await x(t,
|
|
647
|
-
return
|
|
650
|
+
async function gt(t, r) {
|
|
651
|
+
const e = await x(t, Ut);
|
|
652
|
+
return wt(e, r);
|
|
648
653
|
}
|
|
649
|
-
const
|
|
650
|
-
let
|
|
651
|
-
const T = /* @__PURE__ */ new Map(),
|
|
654
|
+
const mt = "avc1.42E01E", Ft = "vp8", Vt = "vp09.00.10.08", Mt = "av01.0.04M.08", Gt = 3, D = (t, r) => self.postMessage(t, r ?? []);
|
|
655
|
+
let U = null, w = !0;
|
|
656
|
+
const T = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
652
657
|
function C(t) {
|
|
653
658
|
const r = t instanceof Error ? t : new Error(String(t));
|
|
654
|
-
|
|
659
|
+
D({ type: "error", error: { name: r.name, message: r.message, stack: r.stack } });
|
|
655
660
|
}
|
|
656
|
-
function
|
|
661
|
+
function m(t, r) {
|
|
657
662
|
return t << 16 | r & 65535;
|
|
658
663
|
}
|
|
659
|
-
function
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
const e =
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
const n = {
|
|
667
|
-
streamId: r,
|
|
668
|
-
numericKey: t,
|
|
664
|
+
function V(t) {
|
|
665
|
+
const r = T.get(t);
|
|
666
|
+
if (r)
|
|
667
|
+
return r;
|
|
668
|
+
const e = {
|
|
669
|
+
streamId: t,
|
|
670
|
+
numericKey: 0,
|
|
669
671
|
watched: !1,
|
|
670
672
|
surface: null,
|
|
671
673
|
ctx2d: null,
|
|
@@ -673,41 +675,34 @@ function z(t, r) {
|
|
|
673
675
|
width: 0,
|
|
674
676
|
height: 0,
|
|
675
677
|
framerate: 0,
|
|
676
|
-
bitrate: 0,
|
|
677
678
|
decoder: null,
|
|
678
679
|
decoderCodec: null,
|
|
679
680
|
isKeyFrameRequired: !0,
|
|
680
681
|
pendingDecodeCount: 0
|
|
681
682
|
};
|
|
682
|
-
return T.set(t,
|
|
683
|
+
return T.set(t, e), e;
|
|
683
684
|
}
|
|
684
|
-
function
|
|
685
|
-
|
|
686
|
-
if (
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
return _;
|
|
690
|
-
}
|
|
691
|
-
const e = t.split("_"), n = Number(e[0]) || 0, s = Number(e[1]) || 0, E = g(n, s);
|
|
692
|
-
return z(E, t);
|
|
693
|
-
}
|
|
694
|
-
function bt(t) {
|
|
695
|
-
if (t === h.H264) return Ft;
|
|
696
|
-
if (t === h.Vp8) return Vt;
|
|
697
|
-
if (t === h.Vp9) return Mt;
|
|
698
|
-
if (t === h.Av1) return Gt;
|
|
685
|
+
function Bt(t) {
|
|
686
|
+
if (t === R.H264) return mt;
|
|
687
|
+
if (t === R.Vp8) return Ft;
|
|
688
|
+
if (t === R.Vp9) return Vt;
|
|
689
|
+
if (t === R.Av1) return Mt;
|
|
699
690
|
throw new Error(`Unknown codec: ${t}`);
|
|
700
691
|
}
|
|
701
|
-
function
|
|
702
|
-
|
|
692
|
+
function h(t) {
|
|
693
|
+
const r = T.get(t);
|
|
694
|
+
if (!r || r.numericKey === 0)
|
|
695
|
+
return;
|
|
696
|
+
const e = r.numericKey >> 16 & 65535, n = r.numericKey & 65535;
|
|
697
|
+
D({ type: "requestIdr", streamId: t, senderId: e, trackId: n });
|
|
703
698
|
}
|
|
704
|
-
async function
|
|
699
|
+
async function bt(t, r) {
|
|
705
700
|
try {
|
|
706
701
|
if (!w || !t.watched)
|
|
707
702
|
return;
|
|
708
703
|
if (typeof createImageBitmap == "function") {
|
|
709
704
|
const e = await createImageBitmap(r);
|
|
710
|
-
|
|
705
|
+
D({ type: "frame", streamId: t.streamId, width: t.width, height: t.height, bitmap: e }, [e]);
|
|
711
706
|
}
|
|
712
707
|
} catch (e) {
|
|
713
708
|
C(e);
|
|
@@ -719,7 +714,7 @@ async function dt(t, r) {
|
|
|
719
714
|
}
|
|
720
715
|
}
|
|
721
716
|
}
|
|
722
|
-
async function
|
|
717
|
+
async function dt(t, r, e) {
|
|
723
718
|
const n = {
|
|
724
719
|
codec: t,
|
|
725
720
|
codedWidth: r > 0 ? r : void 0,
|
|
@@ -746,7 +741,7 @@ async function Ht(t, r, e) {
|
|
|
746
741
|
async function y(t) {
|
|
747
742
|
if (t.codec == null)
|
|
748
743
|
return;
|
|
749
|
-
const r =
|
|
744
|
+
const r = Bt(t.codec);
|
|
750
745
|
if (t.decoder || (t.decoder = new VideoDecoder({
|
|
751
746
|
output: (e) => {
|
|
752
747
|
if (t.pendingDecodeCount++, !w || !t.watched) {
|
|
@@ -757,7 +752,7 @@ async function y(t) {
|
|
|
757
752
|
}
|
|
758
753
|
return;
|
|
759
754
|
}
|
|
760
|
-
if (t.pendingDecodeCount >
|
|
755
|
+
if (t.pendingDecodeCount > Gt) {
|
|
761
756
|
t.pendingDecodeCount--;
|
|
762
757
|
try {
|
|
763
758
|
e.close();
|
|
@@ -780,165 +775,169 @@ async function y(t) {
|
|
|
780
775
|
}
|
|
781
776
|
return;
|
|
782
777
|
}
|
|
783
|
-
|
|
778
|
+
bt(t, e);
|
|
784
779
|
},
|
|
785
780
|
error: (e) => {
|
|
786
|
-
C(e), t.isKeyFrameRequired = !0,
|
|
781
|
+
C(e), t.isKeyFrameRequired = !0, h(t.streamId);
|
|
787
782
|
}
|
|
788
783
|
})), t.decoderCodec !== r) {
|
|
789
|
-
const e = await
|
|
784
|
+
const e = await dt(r, t.width, t.height);
|
|
790
785
|
if (!e) {
|
|
791
786
|
C(new Error(`Decoder not supported for codec ${r}`));
|
|
792
787
|
return;
|
|
793
788
|
}
|
|
794
789
|
t.decoderCodec = r;
|
|
795
790
|
try {
|
|
796
|
-
t.decoder.configure(e.config), t.isKeyFrameRequired = !0,
|
|
791
|
+
t.decoder.configure(e.config), t.isKeyFrameRequired = !0, h(t.streamId);
|
|
797
792
|
const n = e.isHardwareAccelerated ? "hardware" : "software", s = t.framerate > 0 ? `@${Math.round(t.framerate)}fps` : "";
|
|
798
|
-
|
|
793
|
+
D({ type: "log", message: `Decoder configured: codec=${r}, ${t.width}x${t.height}${s}, hw=${n}` });
|
|
799
794
|
} catch (n) {
|
|
800
795
|
C(n);
|
|
801
796
|
}
|
|
802
797
|
t.surface && t.ctx2d && t.width > 0 && t.height > 0 && (t.surface.width !== t.width || t.surface.height !== t.height) && (t.surface.width = t.width, t.surface.height = t.height);
|
|
803
798
|
}
|
|
804
799
|
}
|
|
805
|
-
async function
|
|
806
|
-
const e =
|
|
807
|
-
E.
|
|
800
|
+
async function Ht(t, r) {
|
|
801
|
+
const e = await Rt(t), n = e.StreamId, s = m(r.senderId, r.trackId), E = V(n);
|
|
802
|
+
E.numericKey = s, E.codec = e.Codec, E.width = e.Width, E.height = e.Height, E.framerate = e.Framerate, u.set(s, n), D({ type: "streamBegin", streamId: n, width: e.Width, height: e.Height, codec: e.Codec }), E.watched && (E.surface && E.ctx2d && e.Width > 0 && e.Height > 0 && (E.surface.width !== e.Width || E.surface.height !== e.Height) && (E.surface.width = e.Width, E.surface.height = e.Height), y(E));
|
|
808
803
|
}
|
|
809
|
-
function
|
|
810
|
-
const r =
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
}
|
|
819
|
-
T.delete(r), c.delete(e);
|
|
804
|
+
function Kt(t) {
|
|
805
|
+
const r = m(t.senderId, t.trackId), e = u.get(r);
|
|
806
|
+
if (!e)
|
|
807
|
+
return;
|
|
808
|
+
D({ type: "streamEnd", streamId: e });
|
|
809
|
+
const n = T.get(e);
|
|
810
|
+
if (!n) {
|
|
811
|
+
u.delete(r);
|
|
812
|
+
return;
|
|
820
813
|
}
|
|
814
|
+
if (n.decoder)
|
|
815
|
+
try {
|
|
816
|
+
n.decoder.close();
|
|
817
|
+
} catch {
|
|
818
|
+
}
|
|
819
|
+
T.delete(e), u.delete(r);
|
|
821
820
|
}
|
|
822
|
-
function
|
|
823
|
-
const r =
|
|
824
|
-
|
|
825
|
-
return;
|
|
826
|
-
const e = T.get(r);
|
|
827
|
-
e && (e.surface = null, e.ctx2d = null);
|
|
821
|
+
function W(t) {
|
|
822
|
+
const r = T.get(t);
|
|
823
|
+
r && (r.surface = null, r.ctx2d = null);
|
|
828
824
|
}
|
|
829
|
-
function
|
|
830
|
-
const r =
|
|
831
|
-
if (r
|
|
832
|
-
return;
|
|
833
|
-
const e = T.get(r);
|
|
834
|
-
if (e && (e.watched = !1, e.isKeyFrameRequired = !0, $(t), e.decoder)) {
|
|
825
|
+
function z(t) {
|
|
826
|
+
const r = T.get(t);
|
|
827
|
+
if (r && (r.watched = !1, r.isKeyFrameRequired = !0, W(t), r.decoder)) {
|
|
835
828
|
try {
|
|
836
|
-
|
|
829
|
+
r.decoder.close();
|
|
837
830
|
} catch {
|
|
838
831
|
}
|
|
839
|
-
|
|
832
|
+
r.decoder = null, r.decoderCodec = null;
|
|
840
833
|
}
|
|
841
834
|
}
|
|
842
|
-
async function
|
|
843
|
-
const e =
|
|
844
|
-
if (!n
|
|
835
|
+
async function vt(t, r) {
|
|
836
|
+
const e = m(r.senderId, r.trackId), n = u.get(e);
|
|
837
|
+
if (!n)
|
|
838
|
+
return;
|
|
839
|
+
const s = T.get(n);
|
|
840
|
+
if (!s || !w || !s.watched || ((!s.decoder || !s.decoderCodec) && y(s), !s.decoder || !s.decoderCodec))
|
|
845
841
|
return;
|
|
846
|
-
const
|
|
847
|
-
if (
|
|
848
|
-
if (!
|
|
842
|
+
const E = await gt(t);
|
|
843
|
+
if (s.isKeyFrameRequired) {
|
|
844
|
+
if (!E.IsKey)
|
|
849
845
|
return;
|
|
850
|
-
|
|
846
|
+
s.isKeyFrameRequired = !1;
|
|
851
847
|
}
|
|
852
848
|
try {
|
|
853
|
-
|
|
849
|
+
s.decoder.decode(
|
|
854
850
|
new EncodedVideoChunk({
|
|
855
|
-
type:
|
|
856
|
-
timestamp: Number(
|
|
857
|
-
duration:
|
|
858
|
-
data:
|
|
851
|
+
type: E.IsKey ? "key" : "delta",
|
|
852
|
+
timestamp: Number(E.TimestampInUs),
|
|
853
|
+
duration: E.DurationInUs,
|
|
854
|
+
data: E.Data
|
|
859
855
|
})
|
|
860
856
|
);
|
|
861
|
-
} catch (
|
|
862
|
-
|
|
857
|
+
} catch (_) {
|
|
858
|
+
s.isKeyFrameRequired = !0, h(s.streamId), C(_);
|
|
863
859
|
}
|
|
864
860
|
}
|
|
865
|
-
function
|
|
866
|
-
const r =
|
|
867
|
-
|
|
861
|
+
function xt(t) {
|
|
862
|
+
const r = m(t.senderId, t.trackId), e = u.get(r);
|
|
863
|
+
if (!e)
|
|
864
|
+
return;
|
|
865
|
+
const n = T.get(e);
|
|
866
|
+
n && (n.isKeyFrameRequired = !0, n.watched && h(n.streamId));
|
|
868
867
|
}
|
|
869
868
|
function Yt(t, r) {
|
|
870
869
|
switch (r.opcode) {
|
|
871
870
|
case L.VIDEO_STREAM_BEGIN:
|
|
872
|
-
|
|
871
|
+
Ht(t, r);
|
|
873
872
|
return;
|
|
874
873
|
case L.VIDEO_STREAM_END:
|
|
875
|
-
|
|
874
|
+
Kt(r);
|
|
876
875
|
return;
|
|
877
876
|
case L.VIDEO_FRAME:
|
|
878
|
-
|
|
877
|
+
vt(t, r);
|
|
879
878
|
return;
|
|
880
879
|
case L.VIDEO_INVALIDATE_FRAME:
|
|
881
|
-
|
|
880
|
+
xt(r);
|
|
882
881
|
return;
|
|
883
882
|
default:
|
|
884
883
|
return;
|
|
885
884
|
}
|
|
886
885
|
}
|
|
887
|
-
function
|
|
888
|
-
if (
|
|
886
|
+
function $() {
|
|
887
|
+
if (U) {
|
|
889
888
|
try {
|
|
890
|
-
|
|
889
|
+
U.close();
|
|
891
890
|
} catch {
|
|
892
891
|
}
|
|
893
|
-
|
|
892
|
+
U = null;
|
|
894
893
|
}
|
|
895
894
|
}
|
|
896
|
-
function
|
|
897
|
-
|
|
895
|
+
function kt() {
|
|
896
|
+
$();
|
|
898
897
|
for (const t of T.values())
|
|
899
|
-
|
|
900
|
-
T.clear(),
|
|
898
|
+
z(t.streamId);
|
|
899
|
+
T.clear(), u.clear();
|
|
901
900
|
}
|
|
902
901
|
self.addEventListener("message", (t) => {
|
|
903
902
|
const r = t.data;
|
|
904
903
|
if (r.type !== "configure") {
|
|
905
904
|
if (r.type === "attachSurface") {
|
|
906
|
-
const e = r.streamId, n =
|
|
905
|
+
const e = r.streamId, n = V(e);
|
|
907
906
|
n.watched = !0, n.surface = r.canvas;
|
|
908
907
|
try {
|
|
909
908
|
n.ctx2d = n.surface.getContext("2d", { alpha: !1, desynchronized: !0 });
|
|
910
909
|
} catch (s) {
|
|
911
910
|
C(s), n.ctx2d = null;
|
|
912
911
|
}
|
|
913
|
-
n.isKeyFrameRequired = !0, y(n),
|
|
912
|
+
n.isKeyFrameRequired = !0, y(n), h(e);
|
|
914
913
|
return;
|
|
915
914
|
}
|
|
916
915
|
if (r.type === "detachSurface") {
|
|
917
|
-
|
|
916
|
+
W(r.streamId);
|
|
918
917
|
return;
|
|
919
918
|
}
|
|
920
919
|
if (r.type === "attachProtocolPort") {
|
|
921
|
-
|
|
920
|
+
$(), U = r.port, U.addEventListener("message", (e) => {
|
|
922
921
|
const n = e.data;
|
|
923
922
|
n?.type === "protocol" && n.message instanceof ArrayBuffer && n.headers && Yt(new Uint8Array(n.message), n.headers);
|
|
924
|
-
}),
|
|
923
|
+
}), U.start?.();
|
|
925
924
|
return;
|
|
926
925
|
}
|
|
927
926
|
if (r.type === "watchStream") {
|
|
928
|
-
const e =
|
|
929
|
-
e.watched = !0, e.isKeyFrameRequired = !0, y(e),
|
|
927
|
+
const e = V(r.streamId);
|
|
928
|
+
e.watched = !0, e.isKeyFrameRequired = !0, y(e), h(e.streamId);
|
|
930
929
|
return;
|
|
931
930
|
}
|
|
932
931
|
if (r.type === "unwatchStream") {
|
|
933
|
-
|
|
932
|
+
z(r.streamId);
|
|
934
933
|
return;
|
|
935
934
|
}
|
|
936
935
|
if (r.type === "setEnabled") {
|
|
937
936
|
if (w = r.enabled, w)
|
|
938
937
|
for (const e of T.values())
|
|
939
|
-
e.watched && (e.isKeyFrameRequired = !0, y(e),
|
|
938
|
+
e.watched && (e.isKeyFrameRequired = !0, y(e), h(e.streamId));
|
|
940
939
|
return;
|
|
941
940
|
}
|
|
942
|
-
r.type === "dispose" &&
|
|
941
|
+
r.type === "dispose" && kt();
|
|
943
942
|
}
|
|
944
943
|
});
|