quickvo-sdk-js 0.6.3 → 0.6.4
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/dist/index.js +276 -247
- package/dist/index.umd.cjs +2 -2
- package/dist/room/RoomBase.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var se = Object.defineProperty;
|
|
2
|
+
var re = (a) => {
|
|
3
3
|
throw TypeError(a);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var Z = (a, I, u) =>
|
|
7
|
-
var J = (a, I, u) => (
|
|
8
|
-
const
|
|
5
|
+
var ae = (a, I, u) => I in a ? se(a, I, { enumerable: !0, configurable: !0, writable: !0, value: u }) : a[I] = u;
|
|
6
|
+
var Z = (a, I, u) => ae(a, typeof I != "symbol" ? I + "" : I, u), ce = (a, I, u) => I.has(a) || re("Cannot " + u);
|
|
7
|
+
var J = (a, I, u) => (ce(a, I, "read from private field"), u ? u.call(a) : I.get(a)), at = (a, I, u) => I.has(a) ? re("Cannot add the same private member more than once") : I instanceof WeakSet ? I.add(a) : I.set(a, u), Ot = (a, I, u, E) => (ce(a, I, "write to private field"), E ? E.call(a, u) : I.set(a, u), u);
|
|
8
|
+
const ot = (a, I = {}) => {
|
|
9
|
+
const u = { unit: "B", splitStr: " ", ...I };
|
|
10
|
+
let { unit: E, splitStr: _ } = u;
|
|
11
|
+
const k = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], e = k.findIndex(($) => $ === E), n = k.slice(e + 1, k.length);
|
|
12
|
+
let O = a;
|
|
13
|
+
for (const $ of n)
|
|
14
|
+
if (E = $, O = O / 1024, O < 1024) break;
|
|
15
|
+
return `${O.toFixed(2)}${_}${E}`;
|
|
16
|
+
}, L = (a, I = []) => {
|
|
9
17
|
const u = { ...a }, E = Object.keys(u);
|
|
10
18
|
for (const _ of E)
|
|
11
19
|
I.findIndex((k) => String(k) === _) === -1 && delete u[_];
|
|
@@ -108,8 +116,8 @@ const L = (a, I = []) => {
|
|
|
108
116
|
for (let { k: et, v: tt } of z)
|
|
109
117
|
if (Y = new RegExp(`(${et})`).exec(I), Y) {
|
|
110
118
|
const nt = Y[1];
|
|
111
|
-
let
|
|
112
|
-
nt.includes("W") && (
|
|
119
|
+
let ut = tt.padStart(nt.length, "0");
|
|
120
|
+
nt.includes("W") && (ut = X[ut.slice(0, 2)]), I = I.replace(nt, ut);
|
|
113
121
|
}
|
|
114
122
|
return I;
|
|
115
123
|
}, enum_mediaType = {
|
|
@@ -6157,74 +6165,74 @@ var Deflate_1$1 = Deflate$1, deflate_2 = deflate$1, deflateRaw_1$1 = deflateRaw$
|
|
|
6157
6165
|
};
|
|
6158
6166
|
const BAD$1 = 16209, TYPE$1 = 16191;
|
|
6159
6167
|
var inffast = function a(I, u) {
|
|
6160
|
-
let E, _, k, e, n, O, $, N, D, q, P, j, V, Q, z, Y, et, tt, nt,
|
|
6161
|
-
const
|
|
6162
|
-
E = I.next_in,
|
|
6168
|
+
let E, _, k, e, n, O, $, N, D, q, P, j, V, Q, z, Y, et, tt, nt, ut, it, lt, st, rt;
|
|
6169
|
+
const ct = I.state;
|
|
6170
|
+
E = I.next_in, st = I.input, _ = E + (I.avail_in - 5), k = I.next_out, rt = I.output, e = k - (u - I.avail_out), n = k + (I.avail_out - 257), O = ct.dmax, $ = ct.wsize, N = ct.whave, D = ct.wnext, q = ct.window, P = ct.hold, j = ct.bits, V = ct.lencode, Q = ct.distcode, z = (1 << ct.lenbits) - 1, Y = (1 << ct.distbits) - 1;
|
|
6163
6171
|
t:
|
|
6164
6172
|
do {
|
|
6165
|
-
j < 15 && (P +=
|
|
6173
|
+
j < 15 && (P += st[E++] << j, j += 8, P += st[E++] << j, j += 8), et = V[P & z];
|
|
6166
6174
|
e:
|
|
6167
6175
|
for (; ; ) {
|
|
6168
6176
|
if (tt = et >>> 24, P >>>= tt, j -= tt, tt = et >>> 16 & 255, tt === 0)
|
|
6169
|
-
|
|
6177
|
+
rt[k++] = et & 65535;
|
|
6170
6178
|
else if (tt & 16) {
|
|
6171
|
-
nt = et & 65535, tt &= 15, tt && (j < tt && (P +=
|
|
6179
|
+
nt = et & 65535, tt &= 15, tt && (j < tt && (P += st[E++] << j, j += 8), nt += P & (1 << tt) - 1, P >>>= tt, j -= tt), j < 15 && (P += st[E++] << j, j += 8, P += st[E++] << j, j += 8), et = Q[P & Y];
|
|
6172
6180
|
i:
|
|
6173
6181
|
for (; ; ) {
|
|
6174
6182
|
if (tt = et >>> 24, P >>>= tt, j -= tt, tt = et >>> 16 & 255, tt & 16) {
|
|
6175
|
-
if (
|
|
6176
|
-
I.msg = "invalid distance too far back",
|
|
6183
|
+
if (ut = et & 65535, tt &= 15, j < tt && (P += st[E++] << j, j += 8, j < tt && (P += st[E++] << j, j += 8)), ut += P & (1 << tt) - 1, ut > O) {
|
|
6184
|
+
I.msg = "invalid distance too far back", ct.mode = BAD$1;
|
|
6177
6185
|
break t;
|
|
6178
6186
|
}
|
|
6179
|
-
if (P >>>= tt, j -= tt, tt = k - e,
|
|
6180
|
-
if (tt =
|
|
6181
|
-
I.msg = "invalid distance too far back",
|
|
6187
|
+
if (P >>>= tt, j -= tt, tt = k - e, ut > tt) {
|
|
6188
|
+
if (tt = ut - tt, tt > N && ct.sane) {
|
|
6189
|
+
I.msg = "invalid distance too far back", ct.mode = BAD$1;
|
|
6182
6190
|
break t;
|
|
6183
6191
|
}
|
|
6184
|
-
if (it = 0,
|
|
6192
|
+
if (it = 0, lt = q, D === 0) {
|
|
6185
6193
|
if (it += $ - tt, tt < nt) {
|
|
6186
6194
|
nt -= tt;
|
|
6187
6195
|
do
|
|
6188
|
-
|
|
6196
|
+
rt[k++] = q[it++];
|
|
6189
6197
|
while (--tt);
|
|
6190
|
-
it = k -
|
|
6198
|
+
it = k - ut, lt = rt;
|
|
6191
6199
|
}
|
|
6192
6200
|
} else if (D < tt) {
|
|
6193
6201
|
if (it += $ + D - tt, tt -= D, tt < nt) {
|
|
6194
6202
|
nt -= tt;
|
|
6195
6203
|
do
|
|
6196
|
-
|
|
6204
|
+
rt[k++] = q[it++];
|
|
6197
6205
|
while (--tt);
|
|
6198
6206
|
if (it = 0, D < nt) {
|
|
6199
6207
|
tt = D, nt -= tt;
|
|
6200
6208
|
do
|
|
6201
|
-
|
|
6209
|
+
rt[k++] = q[it++];
|
|
6202
6210
|
while (--tt);
|
|
6203
|
-
it = k -
|
|
6211
|
+
it = k - ut, lt = rt;
|
|
6204
6212
|
}
|
|
6205
6213
|
}
|
|
6206
6214
|
} else if (it += D - tt, tt < nt) {
|
|
6207
6215
|
nt -= tt;
|
|
6208
6216
|
do
|
|
6209
|
-
|
|
6217
|
+
rt[k++] = q[it++];
|
|
6210
6218
|
while (--tt);
|
|
6211
|
-
it = k -
|
|
6219
|
+
it = k - ut, lt = rt;
|
|
6212
6220
|
}
|
|
6213
6221
|
for (; nt > 2; )
|
|
6214
|
-
|
|
6215
|
-
nt && (
|
|
6222
|
+
rt[k++] = lt[it++], rt[k++] = lt[it++], rt[k++] = lt[it++], nt -= 3;
|
|
6223
|
+
nt && (rt[k++] = lt[it++], nt > 1 && (rt[k++] = lt[it++]));
|
|
6216
6224
|
} else {
|
|
6217
|
-
it = k -
|
|
6225
|
+
it = k - ut;
|
|
6218
6226
|
do
|
|
6219
|
-
|
|
6227
|
+
rt[k++] = rt[it++], rt[k++] = rt[it++], rt[k++] = rt[it++], nt -= 3;
|
|
6220
6228
|
while (nt > 2);
|
|
6221
|
-
nt && (
|
|
6229
|
+
nt && (rt[k++] = rt[it++], nt > 1 && (rt[k++] = rt[it++]));
|
|
6222
6230
|
}
|
|
6223
6231
|
} else if ((tt & 64) === 0) {
|
|
6224
6232
|
et = Q[(et & 65535) + (P & (1 << tt) - 1)];
|
|
6225
6233
|
continue i;
|
|
6226
6234
|
} else {
|
|
6227
|
-
I.msg = "invalid distance code",
|
|
6235
|
+
I.msg = "invalid distance code", ct.mode = BAD$1;
|
|
6228
6236
|
break t;
|
|
6229
6237
|
}
|
|
6230
6238
|
break;
|
|
@@ -6233,16 +6241,16 @@ var inffast = function a(I, u) {
|
|
|
6233
6241
|
et = V[(et & 65535) + (P & (1 << tt) - 1)];
|
|
6234
6242
|
continue e;
|
|
6235
6243
|
} else if (tt & 32) {
|
|
6236
|
-
|
|
6244
|
+
ct.mode = TYPE$1;
|
|
6237
6245
|
break t;
|
|
6238
6246
|
} else {
|
|
6239
|
-
I.msg = "invalid literal/length code",
|
|
6247
|
+
I.msg = "invalid literal/length code", ct.mode = BAD$1;
|
|
6240
6248
|
break t;
|
|
6241
6249
|
}
|
|
6242
6250
|
break;
|
|
6243
6251
|
}
|
|
6244
6252
|
} while (E < _ && k < n);
|
|
6245
|
-
nt = j >> 3, E -= nt, j -= nt << 3, P &= (1 << j) - 1, I.next_in = E, I.next_out = k, I.avail_in = E < _ ? 5 + (_ - E) : 5 - (E - _), I.avail_out = k < n ? 257 + (n - k) : 257 - (k - n),
|
|
6253
|
+
nt = j >> 3, E -= nt, j -= nt << 3, P &= (1 << j) - 1, I.next_in = E, I.next_out = k, I.avail_in = E < _ ? 5 + (_ - E) : 5 - (E - _), I.avail_out = k < n ? 257 + (n - k) : 257 - (k - n), ct.hold = P, ct.bits = j;
|
|
6246
6254
|
};
|
|
6247
6255
|
const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS$1 = 1, DISTS$1 = 2, lbase = new Uint16Array([
|
|
6248
6256
|
/* Length codes 257..285 base */
|
|
@@ -6380,48 +6388,48 @@ const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS
|
|
|
6380
6388
|
64
|
|
6381
6389
|
]), inflate_table = (a, I, u, E, _, k, e, n) => {
|
|
6382
6390
|
const O = n.bits;
|
|
6383
|
-
let $ = 0, N = 0, D = 0, q = 0, P = 0, j = 0, V = 0, Q = 0, z = 0, Y = 0, et, tt, nt,
|
|
6384
|
-
const
|
|
6385
|
-
let
|
|
6391
|
+
let $ = 0, N = 0, D = 0, q = 0, P = 0, j = 0, V = 0, Q = 0, z = 0, Y = 0, et, tt, nt, ut, it, lt = null, st;
|
|
6392
|
+
const rt = new Uint16Array(MAXBITS + 1), ct = new Uint16Array(MAXBITS + 1);
|
|
6393
|
+
let $t = null, oe, Ut, Mt;
|
|
6386
6394
|
for ($ = 0; $ <= MAXBITS; $++)
|
|
6387
|
-
|
|
6395
|
+
rt[$] = 0;
|
|
6388
6396
|
for (N = 0; N < E; N++)
|
|
6389
|
-
|
|
6390
|
-
for (P = O, q = MAXBITS; q >= 1 &&
|
|
6397
|
+
rt[I[u + N]]++;
|
|
6398
|
+
for (P = O, q = MAXBITS; q >= 1 && rt[q] === 0; q--)
|
|
6391
6399
|
;
|
|
6392
6400
|
if (P > q && (P = q), q === 0)
|
|
6393
6401
|
return _[k++] = 1 << 24 | 64 << 16 | 0, _[k++] = 1 << 24 | 64 << 16 | 0, n.bits = 1, 0;
|
|
6394
|
-
for (D = 1; D < q &&
|
|
6402
|
+
for (D = 1; D < q && rt[D] === 0; D++)
|
|
6395
6403
|
;
|
|
6396
6404
|
for (P < D && (P = D), Q = 1, $ = 1; $ <= MAXBITS; $++)
|
|
6397
|
-
if (Q <<= 1, Q -=
|
|
6405
|
+
if (Q <<= 1, Q -= rt[$], Q < 0)
|
|
6398
6406
|
return -1;
|
|
6399
6407
|
if (Q > 0 && (a === CODES$1 || q !== 1))
|
|
6400
6408
|
return -1;
|
|
6401
|
-
for (
|
|
6402
|
-
|
|
6409
|
+
for (ct[1] = 0, $ = 1; $ < MAXBITS; $++)
|
|
6410
|
+
ct[$ + 1] = ct[$] + rt[$];
|
|
6403
6411
|
for (N = 0; N < E; N++)
|
|
6404
|
-
I[u + N] !== 0 && (e[
|
|
6405
|
-
if (a === CODES$1 ? (
|
|
6412
|
+
I[u + N] !== 0 && (e[ct[I[u + N]]++] = N);
|
|
6413
|
+
if (a === CODES$1 ? (lt = $t = e, st = 20) : a === LENS$1 ? (lt = lbase, $t = lext, st = 257) : (lt = dbase, $t = dext, st = 0), Y = 0, N = 0, $ = D, it = k, j = P, V = 0, nt = -1, z = 1 << P, ut = z - 1, a === LENS$1 && z > ENOUGH_LENS$1 || a === DISTS$1 && z > ENOUGH_DISTS$1)
|
|
6406
6414
|
return 1;
|
|
6407
6415
|
for (; ; ) {
|
|
6408
|
-
|
|
6416
|
+
oe = $ - V, e[N] + 1 < st ? (Ut = 0, Mt = e[N]) : e[N] >= st ? (Ut = $t[e[N] - st], Mt = lt[e[N] - st]) : (Ut = 96, Mt = 0), et = 1 << $ - V, tt = 1 << j, D = tt;
|
|
6409
6417
|
do
|
|
6410
|
-
tt -= et, _[it + (Y >> V) + tt] =
|
|
6418
|
+
tt -= et, _[it + (Y >> V) + tt] = oe << 24 | Ut << 16 | Mt | 0;
|
|
6411
6419
|
while (tt !== 0);
|
|
6412
6420
|
for (et = 1 << $ - 1; Y & et; )
|
|
6413
6421
|
et >>= 1;
|
|
6414
|
-
if (et !== 0 ? (Y &= et - 1, Y += et) : Y = 0, N++, --
|
|
6422
|
+
if (et !== 0 ? (Y &= et - 1, Y += et) : Y = 0, N++, --rt[$] === 0) {
|
|
6415
6423
|
if ($ === q)
|
|
6416
6424
|
break;
|
|
6417
6425
|
$ = I[u + e[N]];
|
|
6418
6426
|
}
|
|
6419
|
-
if ($ > P && (Y &
|
|
6420
|
-
for (V === 0 && (V = P), it += D, j = $ - V, Q = 1 << j; j + V < q && (Q -=
|
|
6427
|
+
if ($ > P && (Y & ut) !== nt) {
|
|
6428
|
+
for (V === 0 && (V = P), it += D, j = $ - V, Q = 1 << j; j + V < q && (Q -= rt[j + V], !(Q <= 0)); )
|
|
6421
6429
|
j++, Q <<= 1;
|
|
6422
6430
|
if (z += 1 << j, a === LENS$1 && z > ENOUGH_LENS$1 || a === DISTS$1 && z > ENOUGH_DISTS$1)
|
|
6423
6431
|
return 1;
|
|
6424
|
-
nt = Y &
|
|
6432
|
+
nt = Y & ut, _[nt] = P << 24 | j << 16 | it - k | 0;
|
|
6425
6433
|
}
|
|
6426
6434
|
}
|
|
6427
6435
|
return Y !== 0 && (_[it + Y] = $ - V << 24 | 64 << 16 | 0), n.bits = P, 0;
|
|
@@ -6495,16 +6503,16 @@ const fixedtables = (a) => {
|
|
|
6495
6503
|
const k = a.state;
|
|
6496
6504
|
return k.window === null && (k.wsize = 1 << k.wbits, k.wnext = 0, k.whave = 0, k.window = new Uint8Array(k.wsize)), E >= k.wsize ? (k.window.set(I.subarray(u - k.wsize, u), 0), k.wnext = 0, k.whave = k.wsize) : (_ = k.wsize - k.wnext, _ > E && (_ = E), k.window.set(I.subarray(u - E, u - E + _), k.wnext), E -= _, E ? (k.window.set(I.subarray(u - E, u), 0), k.wnext = E, k.whave = k.wsize) : (k.wnext += _, k.wnext === k.wsize && (k.wnext = 0), k.whave < k.wsize && (k.whave += _))), 0;
|
|
6497
6505
|
}, inflate$2 = (a, I) => {
|
|
6498
|
-
let u, E, _, k, e, n, O, $, N, D, q, P, j, V, Q = 0, z, Y, et, tt, nt,
|
|
6499
|
-
const
|
|
6500
|
-
let
|
|
6501
|
-
const
|
|
6506
|
+
let u, E, _, k, e, n, O, $, N, D, q, P, j, V, Q = 0, z, Y, et, tt, nt, ut, it, lt;
|
|
6507
|
+
const st = new Uint8Array(4);
|
|
6508
|
+
let rt, ct;
|
|
6509
|
+
const $t = (
|
|
6502
6510
|
/* permutation of code lengths */
|
|
6503
6511
|
new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
|
|
6504
6512
|
);
|
|
6505
6513
|
if (inflateStateCheck(a) || !a.output || !a.input && a.avail_in !== 0)
|
|
6506
6514
|
return Z_STREAM_ERROR$1;
|
|
6507
|
-
u = a.state, u.mode === TYPE && (u.mode = TYPEDO), e = a.next_out, _ = a.output, O = a.avail_out, k = a.next_in, E = a.input, n = a.avail_in, $ = u.hold, N = u.bits, D = n, q = O,
|
|
6515
|
+
u = a.state, u.mode === TYPE && (u.mode = TYPEDO), e = a.next_out, _ = a.output, O = a.avail_out, k = a.next_in, E = a.input, n = a.avail_in, $ = u.hold, N = u.bits, D = n, q = O, lt = Z_OK$1;
|
|
6508
6516
|
t:
|
|
6509
6517
|
for (; ; )
|
|
6510
6518
|
switch (u.mode) {
|
|
@@ -6519,7 +6527,7 @@ const fixedtables = (a) => {
|
|
|
6519
6527
|
n--, $ += E[k++] << N, N += 8;
|
|
6520
6528
|
}
|
|
6521
6529
|
if (u.wrap & 2 && $ === 35615) {
|
|
6522
|
-
u.wbits === 0 && (u.wbits = 15), u.check = 0,
|
|
6530
|
+
u.wbits === 0 && (u.wbits = 15), u.check = 0, st[0] = $ & 255, st[1] = $ >>> 8 & 255, u.check = crc32_1(u.check, st, 2, 0), $ = 0, N = 0, u.mode = FLAGS;
|
|
6523
6531
|
break;
|
|
6524
6532
|
}
|
|
6525
6533
|
if (u.head && (u.head.done = !1), !(u.wrap & 1) || /* check if zlib header allowed */
|
|
@@ -6551,7 +6559,7 @@ const fixedtables = (a) => {
|
|
|
6551
6559
|
a.msg = "unknown header flags set", u.mode = BAD;
|
|
6552
6560
|
break;
|
|
6553
6561
|
}
|
|
6554
|
-
u.head && (u.head.text = $ >> 8 & 1), u.flags & 512 && u.wrap & 4 && (
|
|
6562
|
+
u.head && (u.head.text = $ >> 8 & 1), u.flags & 512 && u.wrap & 4 && (st[0] = $ & 255, st[1] = $ >>> 8 & 255, u.check = crc32_1(u.check, st, 2, 0)), $ = 0, N = 0, u.mode = TIME;
|
|
6555
6563
|
/* falls through */
|
|
6556
6564
|
case TIME:
|
|
6557
6565
|
for (; N < 32; ) {
|
|
@@ -6559,7 +6567,7 @@ const fixedtables = (a) => {
|
|
|
6559
6567
|
break t;
|
|
6560
6568
|
n--, $ += E[k++] << N, N += 8;
|
|
6561
6569
|
}
|
|
6562
|
-
u.head && (u.head.time = $), u.flags & 512 && u.wrap & 4 && (
|
|
6570
|
+
u.head && (u.head.time = $), u.flags & 512 && u.wrap & 4 && (st[0] = $ & 255, st[1] = $ >>> 8 & 255, st[2] = $ >>> 16 & 255, st[3] = $ >>> 24 & 255, u.check = crc32_1(u.check, st, 4, 0)), $ = 0, N = 0, u.mode = OS;
|
|
6563
6571
|
/* falls through */
|
|
6564
6572
|
case OS:
|
|
6565
6573
|
for (; N < 16; ) {
|
|
@@ -6567,7 +6575,7 @@ const fixedtables = (a) => {
|
|
|
6567
6575
|
break t;
|
|
6568
6576
|
n--, $ += E[k++] << N, N += 8;
|
|
6569
6577
|
}
|
|
6570
|
-
u.head && (u.head.xflags = $ & 255, u.head.os = $ >> 8), u.flags & 512 && u.wrap & 4 && (
|
|
6578
|
+
u.head && (u.head.xflags = $ & 255, u.head.os = $ >> 8), u.flags & 512 && u.wrap & 4 && (st[0] = $ & 255, st[1] = $ >>> 8 & 255, u.check = crc32_1(u.check, st, 2, 0)), $ = 0, N = 0, u.mode = EXLEN;
|
|
6571
6579
|
/* falls through */
|
|
6572
6580
|
case EXLEN:
|
|
6573
6581
|
if (u.flags & 1024) {
|
|
@@ -6576,7 +6584,7 @@ const fixedtables = (a) => {
|
|
|
6576
6584
|
break t;
|
|
6577
6585
|
n--, $ += E[k++] << N, N += 8;
|
|
6578
6586
|
}
|
|
6579
|
-
u.length = $, u.head && (u.head.extra_len = $), u.flags & 512 && u.wrap & 4 && (
|
|
6587
|
+
u.length = $, u.head && (u.head.extra_len = $), u.flags & 512 && u.wrap & 4 && (st[0] = $ & 255, st[1] = $ >>> 8 & 255, u.check = crc32_1(u.check, st, 2, 0)), $ = 0, N = 0;
|
|
6580
6588
|
} else u.head && (u.head.extra = null);
|
|
6581
6589
|
u.mode = EXTRA;
|
|
6582
6590
|
/* falls through */
|
|
@@ -6724,11 +6732,11 @@ const fixedtables = (a) => {
|
|
|
6724
6732
|
break t;
|
|
6725
6733
|
n--, $ += E[k++] << N, N += 8;
|
|
6726
6734
|
}
|
|
6727
|
-
u.lens[
|
|
6735
|
+
u.lens[$t[u.have++]] = $ & 7, $ >>>= 3, N -= 3;
|
|
6728
6736
|
}
|
|
6729
6737
|
for (; u.have < 19; )
|
|
6730
|
-
u.lens[
|
|
6731
|
-
if (u.lencode = u.lendyn, u.lenbits = 7,
|
|
6738
|
+
u.lens[$t[u.have++]] = 0;
|
|
6739
|
+
if (u.lencode = u.lendyn, u.lenbits = 7, rt = { bits: u.lenbits }, lt = inftrees(CODES, u.lens, 0, 19, u.lencode, 0, u.work, rt), u.lenbits = rt.bits, lt) {
|
|
6732
6740
|
a.msg = "invalid code lengths set", u.mode = BAD;
|
|
6733
6741
|
break;
|
|
6734
6742
|
}
|
|
@@ -6745,7 +6753,7 @@ const fixedtables = (a) => {
|
|
|
6745
6753
|
$ >>>= z, N -= z, u.lens[u.have++] = et;
|
|
6746
6754
|
else {
|
|
6747
6755
|
if (et === 16) {
|
|
6748
|
-
for (
|
|
6756
|
+
for (ct = z + 2; N < ct; ) {
|
|
6749
6757
|
if (n === 0)
|
|
6750
6758
|
break t;
|
|
6751
6759
|
n--, $ += E[k++] << N, N += 8;
|
|
@@ -6756,14 +6764,14 @@ const fixedtables = (a) => {
|
|
|
6756
6764
|
}
|
|
6757
6765
|
it = u.lens[u.have - 1], P = 3 + ($ & 3), $ >>>= 2, N -= 2;
|
|
6758
6766
|
} else if (et === 17) {
|
|
6759
|
-
for (
|
|
6767
|
+
for (ct = z + 3; N < ct; ) {
|
|
6760
6768
|
if (n === 0)
|
|
6761
6769
|
break t;
|
|
6762
6770
|
n--, $ += E[k++] << N, N += 8;
|
|
6763
6771
|
}
|
|
6764
6772
|
$ >>>= z, N -= z, it = 0, P = 3 + ($ & 7), $ >>>= 3, N -= 3;
|
|
6765
6773
|
} else {
|
|
6766
|
-
for (
|
|
6774
|
+
for (ct = z + 7; N < ct; ) {
|
|
6767
6775
|
if (n === 0)
|
|
6768
6776
|
break t;
|
|
6769
6777
|
n--, $ += E[k++] << N, N += 8;
|
|
@@ -6784,11 +6792,11 @@ const fixedtables = (a) => {
|
|
|
6784
6792
|
a.msg = "invalid code -- missing end-of-block", u.mode = BAD;
|
|
6785
6793
|
break;
|
|
6786
6794
|
}
|
|
6787
|
-
if (u.lenbits = 9,
|
|
6795
|
+
if (u.lenbits = 9, rt = { bits: u.lenbits }, lt = inftrees(LENS, u.lens, 0, u.nlen, u.lencode, 0, u.work, rt), u.lenbits = rt.bits, lt) {
|
|
6788
6796
|
a.msg = "invalid literal/lengths set", u.mode = BAD;
|
|
6789
6797
|
break;
|
|
6790
6798
|
}
|
|
6791
|
-
if (u.distbits = 6, u.distcode = u.distdyn,
|
|
6799
|
+
if (u.distbits = 6, u.distcode = u.distdyn, rt = { bits: u.distbits }, lt = inftrees(DISTS, u.lens, u.nlen, u.ndist, u.distcode, 0, u.work, rt), u.distbits = rt.bits, lt) {
|
|
6792
6800
|
a.msg = "invalid distances set", u.mode = BAD;
|
|
6793
6801
|
break;
|
|
6794
6802
|
}
|
|
@@ -6809,7 +6817,7 @@ const fixedtables = (a) => {
|
|
|
6809
6817
|
n--, $ += E[k++] << N, N += 8;
|
|
6810
6818
|
}
|
|
6811
6819
|
if (Y && (Y & 240) === 0) {
|
|
6812
|
-
for (tt = z, nt = Y,
|
|
6820
|
+
for (tt = z, nt = Y, ut = et; Q = u.lencode[ut + (($ & (1 << tt + nt) - 1) >> tt)], z = Q >>> 24, Y = Q >>> 16 & 255, et = Q & 65535, !(tt + z <= N); ) {
|
|
6813
6821
|
if (n === 0)
|
|
6814
6822
|
break t;
|
|
6815
6823
|
n--, $ += E[k++] << N, N += 8;
|
|
@@ -6832,7 +6840,7 @@ const fixedtables = (a) => {
|
|
|
6832
6840
|
/* falls through */
|
|
6833
6841
|
case LENEXT:
|
|
6834
6842
|
if (u.extra) {
|
|
6835
|
-
for (
|
|
6843
|
+
for (ct = u.extra; N < ct; ) {
|
|
6836
6844
|
if (n === 0)
|
|
6837
6845
|
break t;
|
|
6838
6846
|
n--, $ += E[k++] << N, N += 8;
|
|
@@ -6848,7 +6856,7 @@ const fixedtables = (a) => {
|
|
|
6848
6856
|
n--, $ += E[k++] << N, N += 8;
|
|
6849
6857
|
}
|
|
6850
6858
|
if ((Y & 240) === 0) {
|
|
6851
|
-
for (tt = z, nt = Y,
|
|
6859
|
+
for (tt = z, nt = Y, ut = et; Q = u.distcode[ut + (($ & (1 << tt + nt) - 1) >> tt)], z = Q >>> 24, Y = Q >>> 16 & 255, et = Q & 65535, !(tt + z <= N); ) {
|
|
6852
6860
|
if (n === 0)
|
|
6853
6861
|
break t;
|
|
6854
6862
|
n--, $ += E[k++] << N, N += 8;
|
|
@@ -6863,7 +6871,7 @@ const fixedtables = (a) => {
|
|
|
6863
6871
|
/* falls through */
|
|
6864
6872
|
case DISTEXT:
|
|
6865
6873
|
if (u.extra) {
|
|
6866
|
-
for (
|
|
6874
|
+
for (ct = u.extra; N < ct; ) {
|
|
6867
6875
|
if (n === 0)
|
|
6868
6876
|
break t;
|
|
6869
6877
|
n--, $ += E[k++] << N, N += 8;
|
|
@@ -6930,10 +6938,10 @@ const fixedtables = (a) => {
|
|
|
6930
6938
|
u.mode = DONE;
|
|
6931
6939
|
/* falls through */
|
|
6932
6940
|
case DONE:
|
|
6933
|
-
|
|
6941
|
+
lt = Z_STREAM_END$1;
|
|
6934
6942
|
break t;
|
|
6935
6943
|
case BAD:
|
|
6936
|
-
|
|
6944
|
+
lt = Z_DATA_ERROR$1;
|
|
6937
6945
|
break t;
|
|
6938
6946
|
case MEM:
|
|
6939
6947
|
return Z_MEM_ERROR$1;
|
|
@@ -6943,7 +6951,7 @@ const fixedtables = (a) => {
|
|
|
6943
6951
|
return Z_STREAM_ERROR$1;
|
|
6944
6952
|
}
|
|
6945
6953
|
return a.next_out = e, a.avail_out = O, a.next_in = k, a.avail_in = n, u.hold = $, u.bits = N, (u.wsize || q !== a.avail_out && u.mode < BAD && (u.mode < CHECK || I !== Z_FINISH$1)) && updatewindow(a, a.output, a.next_out, q - a.avail_out), D -= a.avail_in, q -= a.avail_out, a.total_in += D, a.total_out += q, u.total += q, u.wrap & 4 && q && (a.adler = u.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
|
|
6946
|
-
u.flags ? crc32_1(u.check, _, q, a.next_out - q) : adler32_1(u.check, _, q, a.next_out - q)), a.data_type = u.bits + (u.last ? 64 : 0) + (u.mode === TYPE ? 128 : 0) + (u.mode === LEN_ || u.mode === COPY_ ? 256 : 0), (D === 0 && q === 0 || I === Z_FINISH$1) &&
|
|
6954
|
+
u.flags ? crc32_1(u.check, _, q, a.next_out - q) : adler32_1(u.check, _, q, a.next_out - q)), a.data_type = u.bits + (u.last ? 64 : 0) + (u.mode === TYPE ? 128 : 0) + (u.mode === LEN_ || u.mode === COPY_ ? 256 : 0), (D === 0 && q === 0 || I === Z_FINISH$1) && lt === Z_OK$1 && (lt = Z_BUF_ERROR), lt;
|
|
6947
6955
|
}, inflateEnd = (a) => {
|
|
6948
6956
|
if (inflateStateCheck(a))
|
|
6949
6957
|
return Z_STREAM_ERROR$1;
|
|
@@ -7177,12 +7185,12 @@ const noLogEvents = ["heartbeat", "onNetQuality", "networkQualityChange"], compr
|
|
|
7177
7185
|
}
|
|
7178
7186
|
return a;
|
|
7179
7187
|
};
|
|
7180
|
-
var
|
|
7188
|
+
var wt, dt, xt, yt, kt, Pt, Bt, Lt, jt, Nt, Zt, Ft, Ht;
|
|
7181
7189
|
class CallsWebSocket {
|
|
7182
7190
|
// 状态
|
|
7183
7191
|
constructor(I) {
|
|
7184
|
-
|
|
7185
|
-
|
|
7192
|
+
at(this, wt);
|
|
7193
|
+
at(this, dt, {
|
|
7186
7194
|
url: "wss://demo.putplay.cc/websocket",
|
|
7187
7195
|
// 地址
|
|
7188
7196
|
debug: !1,
|
|
@@ -7191,10 +7199,10 @@ class CallsWebSocket {
|
|
|
7191
7199
|
// 最大重连次数
|
|
7192
7200
|
timeout: 30 * 1e3
|
|
7193
7201
|
});
|
|
7194
|
-
|
|
7202
|
+
at(this, xt, "");
|
|
7195
7203
|
// 缓存登录凭证
|
|
7196
|
-
|
|
7197
|
-
|
|
7204
|
+
at(this, yt, {});
|
|
7205
|
+
at(this, kt, {});
|
|
7198
7206
|
Z(this, "state", "closed");
|
|
7199
7207
|
// 外部 发送消息之前
|
|
7200
7208
|
Z(this, "sendMessageBefore", async () => {
|
|
@@ -7206,33 +7214,33 @@ class CallsWebSocket {
|
|
|
7206
7214
|
Z(this, "onReconnectStop", (I) => {
|
|
7207
7215
|
});
|
|
7208
7216
|
// 是否需要重连
|
|
7209
|
-
|
|
7217
|
+
at(this, Pt, (I) => {
|
|
7210
7218
|
let u = !0;
|
|
7211
7219
|
const { code: E = 1e3, reason: _ = "" } = I;
|
|
7212
7220
|
return E === 1e3 && (_ === "quit success!" || _ === "replace old connection!") && (u = !1), u;
|
|
7213
7221
|
});
|
|
7214
7222
|
// 重连成功
|
|
7215
|
-
|
|
7216
|
-
J(this,
|
|
7223
|
+
at(this, Bt, async (I) => {
|
|
7224
|
+
J(this, dt).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: 重连成功", I), this.state = "connected", this.onReconnectSuccess(I);
|
|
7217
7225
|
});
|
|
7218
7226
|
// 重连停止
|
|
7219
|
-
|
|
7220
|
-
J(this,
|
|
7227
|
+
at(this, Lt, async (I) => {
|
|
7228
|
+
J(this, dt).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: 重连停止", I), this.close(), this.state = "closed", this.onReconnectStop(I);
|
|
7221
7229
|
});
|
|
7222
7230
|
// 自定义心跳规则
|
|
7223
|
-
|
|
7231
|
+
at(this, jt, () => {
|
|
7224
7232
|
const I = { event: "heartbeat", sn: +`${F(1e5, 999999)}` };
|
|
7225
7233
|
return com.quick.voice.proto.CommonReq.encode(I).finish();
|
|
7226
7234
|
});
|
|
7227
7235
|
// 更新日志
|
|
7228
|
-
|
|
7236
|
+
at(this, Nt, (I, u = {}) => {
|
|
7229
7237
|
try {
|
|
7230
7238
|
const { time: E, event: _, data: k = {}, data_original: e = {}, data_remote: n, ...O } = u, $ = U(E, "YYYY-MM-DD hh:mm:ss", { offset: 480 });
|
|
7231
7239
|
let N = {};
|
|
7232
7240
|
const D = (et = {}) => {
|
|
7233
7241
|
const tt = JSON.parse(JSON.stringify(et)), nt = Object.keys(tt);
|
|
7234
|
-
for (const
|
|
7235
|
-
(
|
|
7242
|
+
for (const ut of nt)
|
|
7243
|
+
(ut.includes("sdp") || ut.includes("Sdp")) && (tt[ut] = "");
|
|
7236
7244
|
return tt;
|
|
7237
7245
|
};
|
|
7238
7246
|
let q = "res ↓";
|
|
@@ -7264,24 +7272,24 @@ class CallsWebSocket {
|
|
|
7264
7272
|
}
|
|
7265
7273
|
});
|
|
7266
7274
|
// 创建事件
|
|
7267
|
-
|
|
7275
|
+
at(this, Zt, (I, { resolve: u, reject: E }) => {
|
|
7268
7276
|
const { sn: _ } = I, k = () => {
|
|
7269
|
-
const n = J(this,
|
|
7270
|
-
clearTimeout(n.destructionTimer), delete J(this,
|
|
7277
|
+
const n = J(this, yt)[_];
|
|
7278
|
+
clearTimeout(n.destructionTimer), delete J(this, yt)[_];
|
|
7271
7279
|
}, e = setTimeout(() => {
|
|
7272
|
-
const n = J(this,
|
|
7280
|
+
const n = J(this, yt)[_];
|
|
7273
7281
|
console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo:event is timeout", n.message), k(), E("event is timeout");
|
|
7274
|
-
}, J(this,
|
|
7275
|
-
J(this,
|
|
7282
|
+
}, J(this, dt).timeout);
|
|
7283
|
+
J(this, yt)[_] = { message: I, resolve: u, reject: E, destruction: k, destructionTimer: e };
|
|
7276
7284
|
});
|
|
7277
7285
|
// 获取事件
|
|
7278
|
-
|
|
7286
|
+
at(this, Ft, (I) => J(this, yt)[I]);
|
|
7279
7287
|
// 接收消息
|
|
7280
|
-
|
|
7288
|
+
at(this, Ht, async (I) => {
|
|
7281
7289
|
const u = new Uint8Array(I), E = com.quick.voice.proto.CommonRsp.decode(u), { sn: _, event: k } = E, e = onMessageFormat(E);
|
|
7282
|
-
if (J(this,
|
|
7290
|
+
if (J(this, dt).debug && (noLogEvents.includes(k) || console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#ff0097;padding:16px 0;", "------->quickvo: 响应消息↓", e), ignoreEvent.includes(k) || J(this, Nt).call(this, "res", e)), notifyName_keys.includes(k))
|
|
7283
7291
|
return this.emitNotify(k, L(e, ["code", "data", "desc"]));
|
|
7284
|
-
const O = J(this,
|
|
7292
|
+
const O = J(this, Ft).call(this, _);
|
|
7285
7293
|
if (O) {
|
|
7286
7294
|
const { resolve: $ = (D) => {
|
|
7287
7295
|
}, destruction: N = () => {
|
|
@@ -7291,12 +7299,12 @@ class CallsWebSocket {
|
|
|
7291
7299
|
});
|
|
7292
7300
|
// 清除事件
|
|
7293
7301
|
Z(this, "clearEvents", (I = []) => {
|
|
7294
|
-
const u = Object.keys(J(this,
|
|
7302
|
+
const u = Object.keys(J(this, yt));
|
|
7295
7303
|
I.length === 0 && (I = u);
|
|
7296
7304
|
for (const E of u) {
|
|
7297
7305
|
if (!I.includes(E)) continue;
|
|
7298
|
-
const _ = J(this,
|
|
7299
|
-
clearTimeout(_.destructionTimer), delete J(this,
|
|
7306
|
+
const _ = J(this, yt)[E];
|
|
7307
|
+
clearTimeout(_.destructionTimer), delete J(this, yt)[E];
|
|
7300
7308
|
}
|
|
7301
7309
|
});
|
|
7302
7310
|
/**
|
|
@@ -7305,31 +7313,31 @@ class CallsWebSocket {
|
|
|
7305
7313
|
* @returns
|
|
7306
7314
|
*/
|
|
7307
7315
|
Z(this, "connect", async (I = "") => new Promise(async (u) => {
|
|
7308
|
-
I &&
|
|
7309
|
-
const E = `${J(this,
|
|
7310
|
-
|
|
7311
|
-
...J(this,
|
|
7316
|
+
I && Ot(this, xt, I), J(this, wt) && (await J(this, wt).close(), this.state = "closed");
|
|
7317
|
+
const E = `${J(this, dt).url}?s=${J(this, xt)}&t=${Date.now()}`;
|
|
7318
|
+
Ot(this, wt, new M({
|
|
7319
|
+
...J(this, dt),
|
|
7312
7320
|
url: E,
|
|
7313
7321
|
binaryType: "arraybuffer",
|
|
7314
|
-
onMessage: J(this,
|
|
7315
|
-
checkReconnect: J(this,
|
|
7316
|
-
getHeartbeatMsg: J(this,
|
|
7317
|
-
onReconnectSuccess: J(this,
|
|
7322
|
+
onMessage: J(this, Ht),
|
|
7323
|
+
checkReconnect: J(this, Pt),
|
|
7324
|
+
getHeartbeatMsg: J(this, jt),
|
|
7325
|
+
onReconnectSuccess: J(this, Bt),
|
|
7318
7326
|
onReconnectStop: J(this, Lt)
|
|
7319
|
-
})), this.state = "connecting", await J(this,
|
|
7327
|
+
})), this.state = "connecting", await J(this, wt).connect(), this.state = "connected", J(this, dt).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: 当前广播事件", J(this, kt)), u(J(this, wt));
|
|
7320
7328
|
}));
|
|
7321
7329
|
/**
|
|
7322
7330
|
* 关闭
|
|
7323
7331
|
*/
|
|
7324
7332
|
Z(this, "close", async () => {
|
|
7325
7333
|
var u;
|
|
7326
|
-
J(this,
|
|
7327
|
-
const I = Object.keys(J(this,
|
|
7334
|
+
J(this, dt).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: cws is close.");
|
|
7335
|
+
const I = Object.keys(J(this, yt));
|
|
7328
7336
|
for (const E of I) {
|
|
7329
|
-
const { destructionTimer: _ } = J(this,
|
|
7337
|
+
const { destructionTimer: _ } = J(this, yt)[E];
|
|
7330
7338
|
clearTimeout(_);
|
|
7331
7339
|
}
|
|
7332
|
-
|
|
7340
|
+
Ot(this, yt, {}), await ((u = J(this, wt)) == null ? void 0 : u.close()), Ot(this, wt, void 0), this.state = "closed";
|
|
7333
7341
|
});
|
|
7334
7342
|
/**
|
|
7335
7343
|
* 发送消息
|
|
@@ -7342,14 +7350,14 @@ class CallsWebSocket {
|
|
|
7342
7350
|
event: k,
|
|
7343
7351
|
sn: +`${n}${F(1e3, 9999)}`,
|
|
7344
7352
|
time: n,
|
|
7345
|
-
valid: J(this,
|
|
7353
|
+
valid: J(this, dt).timeout,
|
|
7346
7354
|
version: 1,
|
|
7347
7355
|
compress: !1,
|
|
7348
7356
|
...e
|
|
7349
7357
|
});
|
|
7350
|
-
J(this,
|
|
7358
|
+
J(this, dt).debug && (noLogEvents.includes(k) || console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#ff9700;padding:16px 0;", "------->quickvo: 发送消息↑", O), ignoreEvent.includes(k) || J(this, Nt).call(this, "req", O)), u && J(this, Zt).call(this, O, { resolve: E, reject: _ });
|
|
7351
7359
|
const $ = com.quick.voice.proto.CommonReq.encode(O).finish();
|
|
7352
|
-
(N = J(this,
|
|
7360
|
+
(N = J(this, wt)) == null || N.sendMessage($);
|
|
7353
7361
|
}));
|
|
7354
7362
|
/**
|
|
7355
7363
|
* 触发广播事件
|
|
@@ -7357,7 +7365,7 @@ class CallsWebSocket {
|
|
|
7357
7365
|
* @param result 事件响应值
|
|
7358
7366
|
*/
|
|
7359
7367
|
Z(this, "emitNotify", async (I, u) => {
|
|
7360
|
-
const E = J(this,
|
|
7368
|
+
const E = J(this, kt)[I] || [];
|
|
7361
7369
|
for (const _ of E) {
|
|
7362
7370
|
const { callback: k = async () => {
|
|
7363
7371
|
} } = _;
|
|
@@ -7372,8 +7380,8 @@ class CallsWebSocket {
|
|
|
7372
7380
|
*/
|
|
7373
7381
|
Z(this, "addNotify", (I, u = !1) => {
|
|
7374
7382
|
const { event: E, sn: _ = ht(32) } = I;
|
|
7375
|
-
J(this,
|
|
7376
|
-
const k = J(this,
|
|
7383
|
+
J(this, kt)[E] || (J(this, kt)[E] = []);
|
|
7384
|
+
const k = J(this, kt)[E], e = k.findIndex((n) => n.sn === _);
|
|
7377
7385
|
return e !== -1 && k.splice(e, 1), u ? k.unshift(I) : k.push(I), _;
|
|
7378
7386
|
});
|
|
7379
7387
|
/**
|
|
@@ -7381,18 +7389,18 @@ class CallsWebSocket {
|
|
|
7381
7389
|
*/
|
|
7382
7390
|
Z(this, "removeNotify", (I = []) => {
|
|
7383
7391
|
if (I.length === 0)
|
|
7384
|
-
|
|
7392
|
+
Ot(this, kt, {});
|
|
7385
7393
|
else {
|
|
7386
|
-
const u = Object.keys(J(this,
|
|
7394
|
+
const u = Object.keys(J(this, kt));
|
|
7387
7395
|
for (const E of u)
|
|
7388
|
-
J(this,
|
|
7396
|
+
J(this, kt)[E] = J(this, kt)[E].filter((_) => !I.includes(_.sn || ""));
|
|
7389
7397
|
}
|
|
7390
|
-
J(this,
|
|
7398
|
+
J(this, dt).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: 移除广播事件", J(this, kt));
|
|
7391
7399
|
});
|
|
7392
|
-
|
|
7400
|
+
Ot(this, dt, { ...J(this, dt), ...I });
|
|
7393
7401
|
}
|
|
7394
7402
|
}
|
|
7395
|
-
|
|
7403
|
+
wt = new WeakMap(), dt = new WeakMap(), xt = new WeakMap(), yt = new WeakMap(), kt = new WeakMap(), Pt = new WeakMap(), Bt = new WeakMap(), Lt = new WeakMap(), jt = new WeakMap(), Nt = new WeakMap(), Zt = new WeakMap(), Ft = new WeakMap(), Ht = new WeakMap();
|
|
7396
7404
|
var y = Object.defineProperty, x = (a) => {
|
|
7397
7405
|
throw TypeError(a);
|
|
7398
7406
|
}, g = (a, I, u) => I in a ? y(a, I, { enumerable: !0, configurable: !0, writable: !0, value: u }) : a[I] = u, h = (a, I, u) => g(a, typeof I != "symbol" ? I + "" : I, u), b = (a, I, u) => I.has(a) || x("Cannot " + u), o = (a, I, u) => (b(a, I, "read from private field"), u ? u.call(a) : I.get(a)), f = (a, I, u) => I.has(a) ? x("Cannot add the same private member more than once") : I instanceof WeakSet ? I.add(a) : I.set(a, u), p = (a, I, u, E) => (b(a, I, "write to private field"), I.set(a, u), u), d, c, l;
|
|
@@ -7448,7 +7456,7 @@ class K {
|
|
|
7448
7456
|
}
|
|
7449
7457
|
}
|
|
7450
7458
|
d = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap();
|
|
7451
|
-
var
|
|
7459
|
+
var zt;
|
|
7452
7460
|
class RoomBase {
|
|
7453
7461
|
constructor(I) {
|
|
7454
7462
|
Z(this, "options", {
|
|
@@ -7496,13 +7504,35 @@ class RoomBase {
|
|
|
7496
7504
|
* 提交日志
|
|
7497
7505
|
*/
|
|
7498
7506
|
Z(this, "reportLogs", (I, u = "未知错误") => {
|
|
7499
|
-
const { appid: E, userId: _, earlyId: k = "", logUrl: e } = this.options, n = "web"
|
|
7507
|
+
const { appid: E, userId: _, earlyId: k = "", logUrl: e } = this.options, n = "web", O = ($) => ({
|
|
7508
|
+
ws_c_timeout: 0,
|
|
7509
|
+
// WebSocket 连接超时
|
|
7510
|
+
webrtc_c_timeout: 1,
|
|
7511
|
+
// WebRTC 连接超时
|
|
7512
|
+
join_room_error: 2,
|
|
7513
|
+
// 加入房间失败
|
|
7514
|
+
publish_error: 3,
|
|
7515
|
+
// 发布流失败
|
|
7516
|
+
subscribe_error: 4,
|
|
7517
|
+
// 订阅流失败
|
|
7518
|
+
close_track_error: 5,
|
|
7519
|
+
// 关闭轨道失败
|
|
7520
|
+
heartbeat_e_timeout: 6,
|
|
7521
|
+
// 心跳检测发送超时
|
|
7522
|
+
heartbeat_i_timeout: 7,
|
|
7523
|
+
// 心跳检测接收超时
|
|
7524
|
+
quit_room_error: 8
|
|
7525
|
+
// 退出房间失败
|
|
7526
|
+
})[$].toString();
|
|
7500
7527
|
{
|
|
7501
|
-
const O = { origin: n, type:
|
|
7502
|
-
|
|
7528
|
+
const $ = O(I), N = { origin: n, type: $, app_id: E, user_id: _, ins_id: k, desc: u }, D = btoa(encodeURI(JSON.stringify(N))), q = `${e}/upload/log?log_key=${D}`;
|
|
7529
|
+
{
|
|
7530
|
+
const P = localStorage.getItem("#quickvo.logs") || JSON.stringify([]), V = new TextEncoder().encode(P), Q = pako.deflate(V, { gzip: !0 });
|
|
7531
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: reportLogs", { obj: N, url: q, size: ot(Q.byteLength) }), fetch(q, { headers: { "Content-Type": "multipart/form-data" }, method: "POST", body: Q });
|
|
7532
|
+
}
|
|
7503
7533
|
}
|
|
7504
7534
|
});
|
|
7505
|
-
|
|
7535
|
+
at(this, zt, () => {
|
|
7506
7536
|
this.taskQueue.setCondition("createWs", !0), this.taskQueue.setCondition("createSession", !1), this.taskQueue.setCondition("ice", !1);
|
|
7507
7537
|
});
|
|
7508
7538
|
/**
|
|
@@ -7595,35 +7625,35 @@ class RoomBase {
|
|
|
7595
7625
|
* 处理为应用层数据
|
|
7596
7626
|
*/
|
|
7597
7627
|
Z(this, "usersFilter", (I) => ft(I, ["id", "isSelf", "joinTime", "tracks", "callAction", "callActionStr", "callActionMap", "network", "permissions", "isPublished", "updateStreams"]).sort((_, k) => _.id.localeCompare(k.id, "en")));
|
|
7598
|
-
this.setOptions(I), this.cwsIns = new CallsWebSocket({ ...I }), J(this,
|
|
7628
|
+
this.setOptions(I), this.cwsIns = new CallsWebSocket({ ...I }), J(this, zt).call(this);
|
|
7599
7629
|
}
|
|
7600
7630
|
}
|
|
7601
|
-
|
|
7602
|
-
var
|
|
7631
|
+
zt = new WeakMap();
|
|
7632
|
+
var It, bt, _t, vt, St, Jt, Wt, Rt, Kt;
|
|
7603
7633
|
class RoomMedias extends RoomBase {
|
|
7604
7634
|
// 本地流管理
|
|
7605
7635
|
constructor(u) {
|
|
7606
7636
|
super(u);
|
|
7607
|
-
|
|
7637
|
+
at(this, It, []);
|
|
7608
7638
|
// 可用媒体设备列表
|
|
7609
|
-
|
|
7639
|
+
at(this, bt, /* @__PURE__ */ new Map());
|
|
7610
7640
|
// 媒体流设备管理
|
|
7611
|
-
|
|
7641
|
+
at(this, _t, /* @__PURE__ */ new Map());
|
|
7612
7642
|
// 媒体轨道参数管理
|
|
7613
|
-
|
|
7643
|
+
at(this, vt, /* @__PURE__ */ new Map());
|
|
7614
7644
|
// 媒体流上下文
|
|
7615
|
-
|
|
7645
|
+
at(this, St, []);
|
|
7616
7646
|
/**
|
|
7617
7647
|
* 初始化媒体参数
|
|
7618
7648
|
*/
|
|
7619
|
-
|
|
7620
|
-
J(this,
|
|
7649
|
+
at(this, Jt, () => {
|
|
7650
|
+
J(this, _t).set("microphoneCamera_audio", {}), J(this, _t).set("microphoneCamera_video", { width: { ideal: 1920 }, height: { ideal: 1080 }, frameRate: { min: 10, ideal: 30 } }), J(this, _t).set("screenSharing_video", { width: { ideal: 1920 }, height: { ideal: 1080 }, frameRate: { min: 10, ideal: 30 } }), J(this, _t).set("screenSharing_audio", {});
|
|
7621
7651
|
});
|
|
7622
7652
|
/**
|
|
7623
7653
|
* 初始化媒体设备类型
|
|
7624
7654
|
*/
|
|
7625
|
-
|
|
7626
|
-
J(this,
|
|
7655
|
+
at(this, Wt, () => {
|
|
7656
|
+
J(this, bt).set("audioinput", "default"), J(this, bt).set("videoinput", "default"), J(this, bt).set("audiooutput", "default");
|
|
7627
7657
|
});
|
|
7628
7658
|
/**
|
|
7629
7659
|
* 房间所有用户所有媒体流变化
|
|
@@ -7648,14 +7678,14 @@ class RoomMedias extends RoomBase {
|
|
|
7648
7678
|
case "audio":
|
|
7649
7679
|
{
|
|
7650
7680
|
const $ = new AudioMediaContext(k);
|
|
7651
|
-
J(this,
|
|
7681
|
+
J(this, vt).set(e, $);
|
|
7652
7682
|
}
|
|
7653
7683
|
break;
|
|
7654
7684
|
// 视频媒体处理
|
|
7655
7685
|
case "video":
|
|
7656
7686
|
{
|
|
7657
7687
|
const $ = new VideoMediaContext(k);
|
|
7658
|
-
J(this,
|
|
7688
|
+
J(this, vt).set(e, $);
|
|
7659
7689
|
}
|
|
7660
7690
|
break;
|
|
7661
7691
|
}
|
|
@@ -7663,7 +7693,7 @@ class RoomMedias extends RoomBase {
|
|
|
7663
7693
|
const $ = this.getUserMediaStreamContext(u, E);
|
|
7664
7694
|
if ($ && $.kind === "audio")
|
|
7665
7695
|
try {
|
|
7666
|
-
const N = J(this,
|
|
7696
|
+
const N = J(this, bt).get("audiooutput");
|
|
7667
7697
|
(O = $.audioContext) == null || O.setSinkId(N);
|
|
7668
7698
|
} catch (N) {
|
|
7669
7699
|
console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: setSinkId is error", N);
|
|
@@ -7675,21 +7705,21 @@ class RoomMedias extends RoomBase {
|
|
|
7675
7705
|
*/
|
|
7676
7706
|
Z(this, "getUserMediaStreamContext", (u, E) => {
|
|
7677
7707
|
const _ = this.getUserMediaKey(u, E);
|
|
7678
|
-
return J(this,
|
|
7708
|
+
return J(this, vt).get(_);
|
|
7679
7709
|
});
|
|
7680
7710
|
/**
|
|
7681
7711
|
* 获取用户音频媒体流上下文
|
|
7682
7712
|
*/
|
|
7683
7713
|
Z(this, "getUserAudioMediaStreamContext", (u, E) => {
|
|
7684
7714
|
const _ = this.getUserMediaKey(u, E);
|
|
7685
|
-
return J(this,
|
|
7715
|
+
return J(this, vt).get(_);
|
|
7686
7716
|
});
|
|
7687
7717
|
/**
|
|
7688
7718
|
* 删除用户媒体流上下文
|
|
7689
7719
|
*/
|
|
7690
7720
|
Z(this, "removeUserMediaStreamContext", (u, E) => {
|
|
7691
|
-
const _ = this.getUserMediaKey(u, E), k = J(this,
|
|
7692
|
-
k == null || k.stop(), J(this,
|
|
7721
|
+
const _ = this.getUserMediaKey(u, E), k = J(this, vt).get(_);
|
|
7722
|
+
k == null || k.stop(), J(this, vt).delete(_);
|
|
7693
7723
|
});
|
|
7694
7724
|
/**
|
|
7695
7725
|
* 获取某个用户的某个数据流
|
|
@@ -7722,16 +7752,16 @@ class RoomMedias extends RoomBase {
|
|
|
7722
7752
|
* 清除所有媒体流使用
|
|
7723
7753
|
*/
|
|
7724
7754
|
Z(this, "clearUserStreams", () => {
|
|
7725
|
-
const u = J(this,
|
|
7755
|
+
const u = J(this, vt).values();
|
|
7726
7756
|
for (const E of u)
|
|
7727
7757
|
E.stop();
|
|
7728
|
-
|
|
7758
|
+
Ot(this, vt, /* @__PURE__ */ new Map());
|
|
7729
7759
|
});
|
|
7730
7760
|
/**
|
|
7731
7761
|
* 设置轨道媒体参数
|
|
7732
7762
|
*/
|
|
7733
7763
|
Z(this, "setMediaTrackConstraints", async (u, E) => {
|
|
7734
|
-
J(this,
|
|
7764
|
+
J(this, _t).set(u, E);
|
|
7735
7765
|
const k = this.getUserStream(this.options.userId, u).getTracks();
|
|
7736
7766
|
if (k.length !== 0)
|
|
7737
7767
|
for (const e of k) {
|
|
@@ -7743,12 +7773,12 @@ class RoomMedias extends RoomBase {
|
|
|
7743
7773
|
* 清理所有本地流
|
|
7744
7774
|
*/
|
|
7745
7775
|
Z(this, "clearLocalStream", () => {
|
|
7746
|
-
for (const u of J(this,
|
|
7776
|
+
for (const u of J(this, St)) {
|
|
7747
7777
|
const E = u.getTracks();
|
|
7748
7778
|
for (const _ of E)
|
|
7749
7779
|
_.stop();
|
|
7750
7780
|
}
|
|
7751
|
-
|
|
7781
|
+
Ot(this, St, []);
|
|
7752
7782
|
});
|
|
7753
7783
|
/**
|
|
7754
7784
|
* 初始化本地流
|
|
@@ -7760,32 +7790,32 @@ class RoomMedias extends RoomBase {
|
|
|
7760
7790
|
case "microphoneCamera_audio":
|
|
7761
7791
|
{
|
|
7762
7792
|
this.removeUserMediaStreamContext(E, "microphoneCamera_audio");
|
|
7763
|
-
const _ = J(this,
|
|
7764
|
-
J(this,
|
|
7793
|
+
const _ = J(this, bt).get("audioinput"), k = J(this, _t).get("microphoneCamera_audio"), e = await navigator.mediaDevices.getUserMedia({ audio: { deviceId: _, ...k }, video: !1 });
|
|
7794
|
+
J(this, St).push(e), await this.initUserMediaStreamContext(E, "microphoneCamera_audio", e);
|
|
7765
7795
|
}
|
|
7766
7796
|
break;
|
|
7767
7797
|
// 摄像头
|
|
7768
7798
|
case "microphoneCamera_video":
|
|
7769
7799
|
{
|
|
7770
7800
|
this.removeUserMediaStreamContext(E, "microphoneCamera_video");
|
|
7771
|
-
const _ = J(this,
|
|
7772
|
-
J(this,
|
|
7801
|
+
const _ = J(this, bt).get("videoinput"), k = J(this, _t).get("microphoneCamera_video"), e = await navigator.mediaDevices.getUserMedia({ audio: !1, video: { deviceId: _, ...k } });
|
|
7802
|
+
J(this, St).push(e), await this.initUserMediaStreamContext(E, "microphoneCamera_video", e);
|
|
7773
7803
|
}
|
|
7774
7804
|
break;
|
|
7775
7805
|
// 麦克风 + 摄像头
|
|
7776
7806
|
case "microphoneCamera":
|
|
7777
7807
|
{
|
|
7778
7808
|
this.removeUserMediaStreamContext(E, "microphoneCamera_audio"), this.removeUserMediaStreamContext(E, "microphoneCamera_video");
|
|
7779
|
-
const _ = J(this,
|
|
7780
|
-
J(this,
|
|
7809
|
+
const _ = J(this, bt).get("audioinput"), k = J(this, bt).get("videoinput"), e = J(this, _t).get("microphoneCamera_audio"), n = J(this, _t).get("microphoneCamera_video"), O = await navigator.mediaDevices.getUserMedia({ audio: { deviceId: _, ...e }, video: { deviceId: k, ...n } });
|
|
7810
|
+
J(this, St).push(O), await this.initUserMediaStreamContext(E, "microphoneCamera_audio", O);
|
|
7781
7811
|
}
|
|
7782
7812
|
break;
|
|
7783
7813
|
// 屏幕共享 音频
|
|
7784
7814
|
case "screenSharing_audio":
|
|
7785
7815
|
{
|
|
7786
7816
|
this.removeUserMediaStreamContext(E, "screenSharing_audio");
|
|
7787
|
-
const _ = J(this,
|
|
7788
|
-
J(this,
|
|
7817
|
+
const _ = J(this, _t).get("screenSharing_audio"), k = await navigator.mediaDevices.getDisplayMedia({ audio: !0, video: !0, ..._ });
|
|
7818
|
+
J(this, St).push(k);
|
|
7789
7819
|
const e = k.getTracks();
|
|
7790
7820
|
for (const n of e) {
|
|
7791
7821
|
const { kind: O } = n;
|
|
@@ -7800,8 +7830,8 @@ class RoomMedias extends RoomBase {
|
|
|
7800
7830
|
case "screenSharing_video":
|
|
7801
7831
|
{
|
|
7802
7832
|
this.removeUserMediaStreamContext(E, u);
|
|
7803
|
-
const _ = J(this,
|
|
7804
|
-
J(this,
|
|
7833
|
+
const _ = J(this, _t).get(u), k = await navigator.mediaDevices.getDisplayMedia({ audio: !1, video: !0, ..._ });
|
|
7834
|
+
J(this, St).push(k);
|
|
7805
7835
|
const e = k.getTracks();
|
|
7806
7836
|
for (const n of e) {
|
|
7807
7837
|
const { kind: O } = n;
|
|
@@ -7816,8 +7846,8 @@ class RoomMedias extends RoomBase {
|
|
|
7816
7846
|
case "screenSharing":
|
|
7817
7847
|
{
|
|
7818
7848
|
this.removeUserMediaStreamContext(E, "screenSharing_audio"), this.removeUserMediaStreamContext(E, "screenSharing_video");
|
|
7819
|
-
const _ = J(this,
|
|
7820
|
-
J(this,
|
|
7849
|
+
const _ = J(this, _t).get("screenSharing_audio"), k = J(this, _t).get("screenSharing_video"), e = await navigator.mediaDevices.getDisplayMedia({ audio: !0, video: !0, ..._, ...k });
|
|
7850
|
+
J(this, St).push(e);
|
|
7821
7851
|
const n = e.getTracks();
|
|
7822
7852
|
for (const O of n) {
|
|
7823
7853
|
const { kind: $ } = O;
|
|
@@ -7841,33 +7871,33 @@ class RoomMedias extends RoomBase {
|
|
|
7841
7871
|
/**
|
|
7842
7872
|
* 获取媒体设备列表
|
|
7843
7873
|
*/
|
|
7844
|
-
|
|
7845
|
-
|
|
7874
|
+
at(this, Rt, async () => !navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices ? (console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: 不支持 enumerateDevices"), []) : (await navigator.mediaDevices.enumerateDevices().then((u) => {
|
|
7875
|
+
Ot(this, It, u);
|
|
7846
7876
|
}).catch(function(u) {
|
|
7847
7877
|
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: getEnumerateDevices is err", u);
|
|
7848
|
-
}), J(this,
|
|
7878
|
+
}), J(this, It)));
|
|
7849
7879
|
/**
|
|
7850
7880
|
* 媒体设备发生变化
|
|
7851
7881
|
*/
|
|
7852
|
-
|
|
7882
|
+
at(this, Kt, () => {
|
|
7853
7883
|
navigator.mediaDevices && (navigator.mediaDevices.ondevicechange = async () => {
|
|
7854
|
-
await J(this,
|
|
7855
|
-
}), J(this,
|
|
7884
|
+
await J(this, Rt).call(this), this.cwsIns.emitNotify("onDevicechange", { code: 200, data: {}, desc: "device is change." });
|
|
7885
|
+
}), J(this, Rt).call(this);
|
|
7856
7886
|
});
|
|
7857
7887
|
/**
|
|
7858
7888
|
* 获取正在使用的媒体设备ID
|
|
7859
7889
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
7860
7890
|
* @returns deviceId 设备ID
|
|
7861
7891
|
*/
|
|
7862
|
-
Z(this, "getMediaDeviceKind", (u) => J(this,
|
|
7892
|
+
Z(this, "getMediaDeviceKind", (u) => J(this, bt).get(u));
|
|
7863
7893
|
/**
|
|
7864
7894
|
* 设置正在使用的媒体设备
|
|
7865
7895
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
7866
7896
|
* @param deviceId 设备ID
|
|
7867
7897
|
*/
|
|
7868
7898
|
Z(this, "setDeviceKind", async (u, E) => {
|
|
7869
|
-
if (J(this,
|
|
7870
|
-
const _ = J(this,
|
|
7899
|
+
if (J(this, bt).set(u, E), u === "audiooutput") {
|
|
7900
|
+
const _ = J(this, vt).values();
|
|
7871
7901
|
for (const k of _)
|
|
7872
7902
|
if (k.kind === "audio" && "setSinkId" in HTMLMediaElement.prototype)
|
|
7873
7903
|
try {
|
|
@@ -7888,7 +7918,7 @@ class RoomMedias extends RoomBase {
|
|
|
7888
7918
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
7889
7919
|
* @returns MediaDeviceInfo[]
|
|
7890
7920
|
*/
|
|
7891
|
-
Z(this, "getEnumerateDevices", async (u) => (await J(this,
|
|
7921
|
+
Z(this, "getEnumerateDevices", async (u) => (await J(this, Rt).call(this), J(this, It).filter((_) => _.kind === u)));
|
|
7892
7922
|
/**
|
|
7893
7923
|
* 获取可用音频输入设备
|
|
7894
7924
|
* @returns MediaDeviceInfo[]
|
|
@@ -7904,10 +7934,10 @@ class RoomMedias extends RoomBase {
|
|
|
7904
7934
|
* @returns MediaDeviceInfo[]
|
|
7905
7935
|
*/
|
|
7906
7936
|
Z(this, "getEnumerateVideoinputDevices", () => this.getEnumerateDevices("videoinput"));
|
|
7907
|
-
J(this,
|
|
7937
|
+
J(this, Kt).call(this), J(this, Wt).call(this), J(this, Jt).call(this);
|
|
7908
7938
|
}
|
|
7909
7939
|
}
|
|
7910
|
-
|
|
7940
|
+
It = new WeakMap(), bt = new WeakMap(), _t = new WeakMap(), vt = new WeakMap(), St = new WeakMap(), Jt = new WeakMap(), Wt = new WeakMap(), Rt = new WeakMap(), Kt = new WeakMap();
|
|
7911
7941
|
class RoomUsers extends RoomMedias {
|
|
7912
7942
|
constructor(u) {
|
|
7913
7943
|
super(u);
|
|
@@ -8211,11 +8241,11 @@ const createMutedAudioStream = () => {
|
|
|
8211
8241
|
O.addColorStop(0, `hsla(${k}, 100%, 50%, 0)`), O.addColorStop(1, `hsla(${k + 120}, 100%, 50%, 0)`), _.fillStyle = O, _.fillRect(0, 0, E.width, E.height), k = (k + 1) % 360;
|
|
8212
8242
|
}, 100), E.captureStream(u);
|
|
8213
8243
|
};
|
|
8214
|
-
var
|
|
8244
|
+
var gt, Gt, At, Qt, Vt, Yt;
|
|
8215
8245
|
class RoomPeer extends RoomUsers {
|
|
8216
8246
|
constructor(u) {
|
|
8217
8247
|
super(u);
|
|
8218
|
-
|
|
8248
|
+
at(this, gt, /* @__PURE__ */ new Map());
|
|
8219
8249
|
// 假媒体流 (创建轨道用)
|
|
8220
8250
|
Z(this, "getPeerStatsTimer", 0);
|
|
8221
8251
|
// 获取报告的定时器
|
|
@@ -8234,28 +8264,28 @@ class RoomPeer extends RoomUsers {
|
|
|
8234
8264
|
// 网络抖动
|
|
8235
8265
|
});
|
|
8236
8266
|
Z(this, "initPeer", () => {
|
|
8237
|
-
this.peerIns = new RTCPeerConnection({ bundlePolicy: "max-bundle" }), this.transceiverMap = /* @__PURE__ */ new Map(), J(this,
|
|
8267
|
+
this.peerIns = new RTCPeerConnection({ bundlePolicy: "max-bundle" }), this.transceiverMap = /* @__PURE__ */ new Map(), J(this, Qt).call(this), J(this, Yt).call(this);
|
|
8238
8268
|
});
|
|
8239
8269
|
// 初始化假数据流
|
|
8240
|
-
|
|
8270
|
+
at(this, Gt, () => {
|
|
8241
8271
|
for (const u of mediaType_keys)
|
|
8242
8272
|
switch (u) {
|
|
8243
8273
|
case "microphoneCamera_audio":
|
|
8244
|
-
J(this,
|
|
8274
|
+
J(this, gt).set("microphoneCamera_audio", createMutedAudioStream());
|
|
8245
8275
|
break;
|
|
8246
8276
|
case "microphoneCamera_video":
|
|
8247
|
-
J(this,
|
|
8277
|
+
J(this, gt).set("microphoneCamera_video", createFakeVideoStream());
|
|
8248
8278
|
break;
|
|
8249
8279
|
case "screenSharing_audio":
|
|
8250
|
-
J(this,
|
|
8280
|
+
J(this, gt).set("screenSharing_audio", createMutedAudioStream());
|
|
8251
8281
|
break;
|
|
8252
8282
|
case "screenSharing_video":
|
|
8253
|
-
J(this,
|
|
8283
|
+
J(this, gt).set("screenSharing_video", createFakeVideoStream());
|
|
8254
8284
|
break;
|
|
8255
8285
|
}
|
|
8256
8286
|
});
|
|
8257
8287
|
// 获取假数据流
|
|
8258
|
-
|
|
8288
|
+
at(this, At, (u) => J(this, gt).get(u));
|
|
8259
8289
|
/**
|
|
8260
8290
|
* 替换发射器媒体流
|
|
8261
8291
|
*/
|
|
@@ -8267,7 +8297,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8267
8297
|
let n;
|
|
8268
8298
|
if (e) {
|
|
8269
8299
|
const { sender: O } = e;
|
|
8270
|
-
E ? n = this.getUserStream(_, k) : n = J(this,
|
|
8300
|
+
E ? n = this.getUserStream(_, k) : n = J(this, At).call(this, k);
|
|
8271
8301
|
const [$] = n.getTracks();
|
|
8272
8302
|
await O.replaceTrack($);
|
|
8273
8303
|
}
|
|
@@ -8292,11 +8322,11 @@ class RoomPeer extends RoomUsers {
|
|
|
8292
8322
|
* 添加发射器
|
|
8293
8323
|
*/
|
|
8294
8324
|
Z(this, "addSenders", async (u = []) => {
|
|
8295
|
-
u.length === 0 && this.peerIns.addTransceiver("audio", { direction: "sendonly" });
|
|
8325
|
+
u.length === 0 && (this.peerIns.addTransceiver("audio", { direction: "sendonly" }), this.peerIns.addTransceiver("video", { direction: "sendonly" }));
|
|
8296
8326
|
const E = [];
|
|
8297
8327
|
for (const _ of u) {
|
|
8298
8328
|
if (this.transceiverMap.has(_)) continue;
|
|
8299
|
-
const k = J(this,
|
|
8329
|
+
const k = J(this, At).call(this, _), [e] = k.getTracks(), n = this.peerIns.addTransceiver(e, { direction: "sendonly" });
|
|
8300
8330
|
this.transceiverMap.set(_, n), E.push(_);
|
|
8301
8331
|
}
|
|
8302
8332
|
if (u.length === 0 || E.length) {
|
|
@@ -8382,7 +8412,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8382
8412
|
/**
|
|
8383
8413
|
* 监听webrtc ice通讯连接
|
|
8384
8414
|
*/
|
|
8385
|
-
|
|
8415
|
+
at(this, Qt, () => {
|
|
8386
8416
|
let u = 0;
|
|
8387
8417
|
const E = () => {
|
|
8388
8418
|
this.setRoomState("closed");
|
|
@@ -8532,33 +8562,33 @@ class RoomPeer extends RoomUsers {
|
|
|
8532
8562
|
/**
|
|
8533
8563
|
* 计算网络质量
|
|
8534
8564
|
*/
|
|
8535
|
-
|
|
8565
|
+
at(this, Vt, async () => {
|
|
8536
8566
|
try {
|
|
8537
8567
|
const u = await this.peerIns.getStats(), E = ["inbound-rtp", "remote-inbound-rtp", "outbound-rtp"], k = [...u.values()].filter((nt) => E.includes(nt.type));
|
|
8538
8568
|
let e = 0, n = 0, O = 0, $ = 0, N = 0, D = 0, q = [], P = [];
|
|
8539
8569
|
for (const nt of this.reports) {
|
|
8540
|
-
const { packetsSent:
|
|
8541
|
-
|
|
8570
|
+
const { packetsSent: ut, packetsLost: it } = nt;
|
|
8571
|
+
ut && (O += ut), it && ($ += it);
|
|
8542
8572
|
}
|
|
8543
8573
|
this.reports = k;
|
|
8544
8574
|
for (const nt of this.reports) {
|
|
8545
|
-
const { bytesReceived:
|
|
8546
|
-
|
|
8575
|
+
const { bytesReceived: ut, bytesSent: it, packetsSent: lt, packetsLost: st, jitter: rt, roundTripTime: ct } = nt;
|
|
8576
|
+
ut && (e = ut), it && (n = it), lt && (N += lt), st && (D += st), ct && q.push((ct * 100).toFixed(2)), rt && P.push(rt.toFixed(2));
|
|
8547
8577
|
}
|
|
8548
8578
|
P.sort().reverse(), q.sort().reverse();
|
|
8549
8579
|
const j = N - O, V = D - $, Q = j === 0 ? "0.00" : (V / j).toFixed(2), [z = "0"] = q, [Y = "0"] = P, et = { inboundBytes: e, outboundBytes: n, lostRate: Q, roundTripTime: z, jitter: Y };
|
|
8550
8580
|
this.peerNetwork = et;
|
|
8551
|
-
const tt = (nt,
|
|
8552
|
-
const
|
|
8553
|
-
let
|
|
8554
|
-
return
|
|
8581
|
+
const tt = (nt, ut, it) => {
|
|
8582
|
+
const lt = Number(nt), st = Number(ut), rt = Number(it);
|
|
8583
|
+
let ct = "0";
|
|
8584
|
+
return lt < 0.03 && st < 100 && rt < 0.05 ? ct = "5" : lt < 0.06 && st < 160 && rt < 0.1 ? ct = "4" : lt < 0.1 && st < 250 && rt < 0.15 ? ct = "3" : lt < 0.15 && st < 400 && rt < 0.2 ? ct = "2" : ct = "1", Number(ct);
|
|
8555
8585
|
};
|
|
8556
8586
|
{
|
|
8557
|
-
const nt = tt(Q, z, Y),
|
|
8558
|
-
if (await this.updateUserNetwork(this.options.userId,
|
|
8587
|
+
const nt = tt(Q, z, Y), ut = await this.getCaller(), { network: it } = ut, lt = { egress: nt, ingress: nt }, st = JSON.stringify(it) !== JSON.stringify(lt);
|
|
8588
|
+
if (await this.updateUserNetwork(this.options.userId, lt), st) {
|
|
8559
8589
|
this.emitNotifyUpdateUsers();
|
|
8560
|
-
const { userId:
|
|
8561
|
-
this.cwsIns.sendMessage({ event: "networkQualityChange", data: { ...
|
|
8590
|
+
const { userId: rt, roomId: ct } = this.options;
|
|
8591
|
+
this.cwsIns.sendMessage({ event: "networkQualityChange", data: { ...lt, userId: rt, roomId: ct } }, !1);
|
|
8562
8592
|
}
|
|
8563
8593
|
}
|
|
8564
8594
|
} catch (u) {
|
|
@@ -8568,9 +8598,9 @@ class RoomPeer extends RoomUsers {
|
|
|
8568
8598
|
/**
|
|
8569
8599
|
* 获取连接的所有轨道分析数据
|
|
8570
8600
|
*/
|
|
8571
|
-
|
|
8601
|
+
at(this, Yt, () => {
|
|
8572
8602
|
const u = async () => {
|
|
8573
|
-
this.peerIns.connectionState !== "connected" || !this.options.roomId || J(this,
|
|
8603
|
+
this.peerIns.connectionState !== "connected" || !this.options.roomId || J(this, Vt).call(this);
|
|
8574
8604
|
};
|
|
8575
8605
|
this.getPeerStatsTimer = setInterval(u, 1 * 1e3);
|
|
8576
8606
|
});
|
|
@@ -8578,11 +8608,11 @@ class RoomPeer extends RoomUsers {
|
|
|
8578
8608
|
* 停止网络报告分析
|
|
8579
8609
|
*/
|
|
8580
8610
|
Z(this, "stopGetPeerStats", () => clearInterval(this.getPeerStatsTimer));
|
|
8581
|
-
J(this,
|
|
8611
|
+
J(this, Gt).call(this);
|
|
8582
8612
|
}
|
|
8583
8613
|
}
|
|
8584
|
-
|
|
8585
|
-
var
|
|
8614
|
+
gt = new WeakMap(), Gt = new WeakMap(), At = new WeakMap(), Qt = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap();
|
|
8615
|
+
var Xt, Et, qt, Dt, Ct;
|
|
8586
8616
|
class RoomCalls extends RoomPeer {
|
|
8587
8617
|
constructor(u) {
|
|
8588
8618
|
super(u);
|
|
@@ -8592,7 +8622,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8592
8622
|
* 广播给房间其他人
|
|
8593
8623
|
* 只有当自己建立了发射轨道 并且 加入房间后才进行广播
|
|
8594
8624
|
*/
|
|
8595
|
-
|
|
8625
|
+
at(this, Xt, async (u) => {
|
|
8596
8626
|
const { roomId: E } = this.options;
|
|
8597
8627
|
if (!E) return;
|
|
8598
8628
|
const { id: _, tracks: k = [] } = await this.getCaller();
|
|
@@ -8603,7 +8633,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8603
8633
|
/**
|
|
8604
8634
|
* 更新自己通话状态
|
|
8605
8635
|
*/
|
|
8606
|
-
|
|
8636
|
+
at(this, Et, async (u) => new Promise(async (E, _) => {
|
|
8607
8637
|
const { roomId: k, userId: e } = this.options, n = { roomId: k, user: { id: e, callAction: u } };
|
|
8608
8638
|
await this.cwsIns.sendMessage({ event: "updateCall", data: n }).then(async (O) => {
|
|
8609
8639
|
const { code: $ = 0 } = O;
|
|
@@ -8614,7 +8644,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8614
8644
|
/**
|
|
8615
8645
|
* 创建连接
|
|
8616
8646
|
*/
|
|
8617
|
-
|
|
8647
|
+
at(this, qt, () => new Promise(async (u, E) => {
|
|
8618
8648
|
try {
|
|
8619
8649
|
if (["connecting", "connected"].includes(this.cwsIns.state)) return u(!0);
|
|
8620
8650
|
this.taskQueue.setCondition("createWs", !1), this.cwsIns.clearEvents(), this.initPeer();
|
|
@@ -8629,19 +8659,19 @@ class RoomCalls extends RoomPeer {
|
|
|
8629
8659
|
};
|
|
8630
8660
|
if (this.isEarly) {
|
|
8631
8661
|
const N = ht();
|
|
8632
|
-
O.i = N;
|
|
8662
|
+
O.i = N, this.setOptions({ earlyId: N });
|
|
8633
8663
|
}
|
|
8634
8664
|
this.options.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: createWs", O);
|
|
8635
8665
|
const $ = btoa(encodeURI(JSON.stringify(O)));
|
|
8636
8666
|
await this.cwsIns.connect($), this.taskQueue.setCondition("createWs", !0), u(!0);
|
|
8637
8667
|
} catch (_) {
|
|
8638
|
-
console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: createWs is error.", _), E(_);
|
|
8668
|
+
console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: createWs is error.", _), this.reportLogs("ws_c_timeout", _.message || _), E(_);
|
|
8639
8669
|
}
|
|
8640
8670
|
}));
|
|
8641
8671
|
/**
|
|
8642
8672
|
* 创建cf会话
|
|
8643
8673
|
*/
|
|
8644
|
-
|
|
8674
|
+
at(this, Dt, () => {
|
|
8645
8675
|
if (!["connecting", "connected"].includes(this.roomState))
|
|
8646
8676
|
return this.setRoomState("connecting"), new Promise((u) => {
|
|
8647
8677
|
const E = async () => {
|
|
@@ -8665,7 +8695,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8665
8695
|
u(!0);
|
|
8666
8696
|
});
|
|
8667
8697
|
} catch (_) {
|
|
8668
|
-
|
|
8698
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo create session is error.", _), this.taskQueue.setCondition("createSession", !0), this.reportLogs("ws_c_timeout", _.message || _);
|
|
8669
8699
|
}
|
|
8670
8700
|
};
|
|
8671
8701
|
this.taskQueue.addTask(E, ["createWs"], { key: "createSession", describe: "createSession" });
|
|
@@ -8677,12 +8707,12 @@ class RoomCalls extends RoomPeer {
|
|
|
8677
8707
|
* @example quickvo.earlyConnect(['microphoneCamera_audio', 'microphoneCamera_video'])
|
|
8678
8708
|
*/
|
|
8679
8709
|
Z(this, "earlyConnect", (u = []) => {
|
|
8680
|
-
this.isEarly = !0, J(this,
|
|
8710
|
+
this.isEarly = !0, J(this, qt).call(this), J(this, Dt).call(this), u.length === 0 && (u = ["microphoneCamera_audio", "microphoneCamera_video"]), J(this, Ct).call(this, u);
|
|
8681
8711
|
});
|
|
8682
8712
|
/**
|
|
8683
8713
|
* 创建媒体轨道
|
|
8684
8714
|
*/
|
|
8685
|
-
|
|
8715
|
+
at(this, Ct, async (u) => new Promise((E) => {
|
|
8686
8716
|
const _ = async () => {
|
|
8687
8717
|
try {
|
|
8688
8718
|
this.taskQueue.setCondition("createTrack", !1);
|
|
@@ -8694,13 +8724,12 @@ class RoomCalls extends RoomPeer {
|
|
|
8694
8724
|
data: { sdp: this.getSdp(), tracks: e, callAction: 0 }
|
|
8695
8725
|
}).then(async (n) => {
|
|
8696
8726
|
const { code: O = 0, desc: $, data: N } = n;
|
|
8697
|
-
if (O !== 200)
|
|
8698
|
-
throw this.options.debug && console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: createTrack is error.", { mediaTypes: u }), new Error($);
|
|
8727
|
+
if (O !== 200) throw new Error($);
|
|
8699
8728
|
const { remoteSdp: D } = N;
|
|
8700
8729
|
await this.setRemoteDescription({ type: "answer", sdp: D }), this.taskQueue.setCondition("createTrack", !0), E(!0);
|
|
8701
8730
|
});
|
|
8702
8731
|
} catch (k) {
|
|
8703
|
-
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: createTrack is error.", k), await this.removeSenders(u), this.taskQueue.setCondition("createTrack", !0), E(!0);
|
|
8732
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: createTrack is error.", k), await this.removeSenders(u), this.taskQueue.setCondition("createTrack", !0), this.reportLogs("publish_error", k.message || k), E(!0);
|
|
8704
8733
|
}
|
|
8705
8734
|
};
|
|
8706
8735
|
this.taskQueue.addTask(_, ["createWs", "createSession", "ice", "subscribe", "createTrack", "closeTrack"], { describe: "createTrack" });
|
|
@@ -8780,7 +8809,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8780
8809
|
* @example quickvo.joinRoom({ userId: '', roomId: '', sdkToken: '', callType: '1' , newPublishAutoSubscribe: true })
|
|
8781
8810
|
* @returns Promise<boolean>
|
|
8782
8811
|
*/
|
|
8783
|
-
Z(this, "joinRoom", async (u) => (this.setOptions(u), await J(this,
|
|
8812
|
+
Z(this, "joinRoom", async (u) => (this.setOptions(u), await J(this, qt).call(this), new Promise((E, _) => {
|
|
8784
8813
|
this.clearUsers();
|
|
8785
8814
|
let k = "";
|
|
8786
8815
|
const e = async () => {
|
|
@@ -8799,7 +8828,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8799
8828
|
if (q !== 200) return _(P);
|
|
8800
8829
|
const { roomId: V = "", roomUsers: Q = [] } = j;
|
|
8801
8830
|
if (V !== O) return _("加入的房间不匹配");
|
|
8802
|
-
this.isInRoom = !0, J(this,
|
|
8831
|
+
this.isInRoom = !0, J(this, Dt).call(this), await this.updateUsers(Q), e();
|
|
8803
8832
|
});
|
|
8804
8833
|
} catch (O) {
|
|
8805
8834
|
this.taskQueue.setCondition("joinRoom", !0), this.reportLogs("join_room_error", O.message || O), _(`加入房间失败: ${O.message || O || "服务器繁忙"}`);
|
|
@@ -8872,11 +8901,11 @@ class RoomCalls extends RoomPeer {
|
|
|
8872
8901
|
for (const q of u)
|
|
8873
8902
|
this.getUserStream(e.id, q).getTracks().length === 0 && n.push(q);
|
|
8874
8903
|
const O = u.filter((q) => !n.includes(q) || ["microphoneCamera_audio", "microphoneCamera_video"].includes(q));
|
|
8875
|
-
await J(this,
|
|
8904
|
+
await J(this, Ct).call(this, O);
|
|
8876
8905
|
const $ = await this.getSenderTracks(O), N = [...e.tracks, ...$];
|
|
8877
8906
|
await this.updateUsertracks(e.id, N, !0);
|
|
8878
8907
|
const D = await this.getCallAction(N);
|
|
8879
|
-
await J(this,
|
|
8908
|
+
await J(this, Et).call(this, D), J(this, Xt).call(this, u), await this.replaceSenderStream(O, !0), n.length !== 0 && await this.inactiveTracks(n, !1);
|
|
8880
8909
|
{
|
|
8881
8910
|
await this.emitNotifyUpdateUsers();
|
|
8882
8911
|
const q = await this.getCaller();
|
|
@@ -8909,7 +8938,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8909
8938
|
await this.replaceSenderStream(u, !1), await this.closeUserTracks(e.id, n, !0), await this.removeSenders(u);
|
|
8910
8939
|
{
|
|
8911
8940
|
const $ = await this.getCallAction(e.tracks);
|
|
8912
|
-
await J(this,
|
|
8941
|
+
await J(this, Et).call(this, $);
|
|
8913
8942
|
}
|
|
8914
8943
|
await this.createOffer(), await this.cwsIns.sendMessage({
|
|
8915
8944
|
event: "closeTrack",
|
|
@@ -9046,7 +9075,7 @@ class RoomCalls extends RoomPeer {
|
|
|
9046
9075
|
}
|
|
9047
9076
|
}
|
|
9048
9077
|
const O = await this.getCallAction(n);
|
|
9049
|
-
await J(this,
|
|
9078
|
+
await J(this, Et).call(this, O), await this.emitNotifyUpdateUsers(), _(!0);
|
|
9050
9079
|
}));
|
|
9051
9080
|
/**
|
|
9052
9081
|
* 远端调试
|
|
@@ -9061,21 +9090,21 @@ class RoomCalls extends RoomPeer {
|
|
|
9061
9090
|
}));
|
|
9062
9091
|
}
|
|
9063
9092
|
}
|
|
9064
|
-
|
|
9093
|
+
Xt = new WeakMap(), Et = new WeakMap(), qt = new WeakMap(), Dt = new WeakMap(), Ct = new WeakMap();
|
|
9065
9094
|
class Room extends RoomCalls {
|
|
9066
9095
|
constructor(I) {
|
|
9067
9096
|
super(I);
|
|
9068
9097
|
}
|
|
9069
9098
|
}
|
|
9070
|
-
var
|
|
9099
|
+
var Tt, te, ee, ie, ne;
|
|
9071
9100
|
class QuickVO extends Room {
|
|
9072
9101
|
constructor(u) {
|
|
9073
9102
|
super(u);
|
|
9074
|
-
|
|
9103
|
+
at(this, Tt, /* @__PURE__ */ new Map());
|
|
9075
9104
|
/**
|
|
9076
9105
|
* 添加内部监听事件
|
|
9077
9106
|
*/
|
|
9078
|
-
|
|
9107
|
+
at(this, te, () => {
|
|
9079
9108
|
{
|
|
9080
9109
|
const u = async (E) => {
|
|
9081
9110
|
const { qualities: _ = [] } = E.data, [k] = _;
|
|
@@ -9156,12 +9185,12 @@ class QuickVO extends Room {
|
|
|
9156
9185
|
/**
|
|
9157
9186
|
* cwsIns 发送消息前
|
|
9158
9187
|
*/
|
|
9159
|
-
|
|
9188
|
+
at(this, ee, () => {
|
|
9160
9189
|
});
|
|
9161
9190
|
/**
|
|
9162
9191
|
* 重连成功
|
|
9163
9192
|
*/
|
|
9164
|
-
|
|
9193
|
+
at(this, ie, () => {
|
|
9165
9194
|
this.cwsIns.onReconnectSuccess = async () => {
|
|
9166
9195
|
await this.syncRoomInfo();
|
|
9167
9196
|
};
|
|
@@ -9169,7 +9198,7 @@ class QuickVO extends Room {
|
|
|
9169
9198
|
/**
|
|
9170
9199
|
* 重连停止
|
|
9171
9200
|
*/
|
|
9172
|
-
|
|
9201
|
+
at(this, ne, async () => {
|
|
9173
9202
|
});
|
|
9174
9203
|
/**
|
|
9175
9204
|
* 添加 FrameRequestCallback
|
|
@@ -9178,13 +9207,13 @@ class QuickVO extends Room {
|
|
|
9178
9207
|
*/
|
|
9179
9208
|
Z(this, "addRequestAnimationFrame", async (u, E) => {
|
|
9180
9209
|
{
|
|
9181
|
-
const k = J(this,
|
|
9210
|
+
const k = J(this, Tt).get(u);
|
|
9182
9211
|
k && cancelAnimationFrame(k);
|
|
9183
9212
|
}
|
|
9184
9213
|
const _ = (k = Date.now()) => {
|
|
9185
9214
|
E(k);
|
|
9186
9215
|
const e = requestAnimationFrame(_);
|
|
9187
|
-
J(this,
|
|
9216
|
+
J(this, Tt).set(u, e);
|
|
9188
9217
|
};
|
|
9189
9218
|
_();
|
|
9190
9219
|
});
|
|
@@ -9193,10 +9222,10 @@ class QuickVO extends Room {
|
|
|
9193
9222
|
* @param keys string[] = []
|
|
9194
9223
|
*/
|
|
9195
9224
|
Z(this, "clearRequestAnimationFrame", async (u = []) => {
|
|
9196
|
-
u.length === 0 && (u = [...J(this,
|
|
9225
|
+
u.length === 0 && (u = [...J(this, Tt).keys()]);
|
|
9197
9226
|
const E = [];
|
|
9198
9227
|
for (const _ of u) {
|
|
9199
|
-
const k = J(this,
|
|
9228
|
+
const k = J(this, Tt).get(_);
|
|
9200
9229
|
k && (cancelAnimationFrame(k), E.push(k));
|
|
9201
9230
|
}
|
|
9202
9231
|
return E;
|
|
@@ -9208,10 +9237,10 @@ class QuickVO extends Room {
|
|
|
9208
9237
|
Z(this, "destroy", async () => {
|
|
9209
9238
|
this.options.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: 销毁SDK"), this.stopGetPeerStats(), this.clearUsers(), this.clearUserStreams(), this.cwsIns.clearEvents(), this.cwsIns.emitNotify("onDestroy", { code: 200, data: {}, desc: "sdk is destroy." }), await this.cwsIns.close();
|
|
9210
9239
|
});
|
|
9211
|
-
J(this,
|
|
9240
|
+
J(this, ee).call(this), J(this, ie).call(this), J(this, ne).call(this), J(this, te).call(this);
|
|
9212
9241
|
}
|
|
9213
9242
|
}
|
|
9214
|
-
|
|
9243
|
+
Tt = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ie = new WeakMap(), ne = new WeakMap();
|
|
9215
9244
|
export {
|
|
9216
9245
|
QuickVO,
|
|
9217
9246
|
ignoreEvent
|