quickvo-sdk-js 0.6.2 → 0.6.3
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 +267 -252
- package/dist/index.umd.cjs +2 -2
- package/dist/room/RoomMedias.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ce = Object.defineProperty;
|
|
2
|
+
var oe = (a) => {
|
|
3
3
|
throw TypeError(a);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var Z = (a, I, u) =>
|
|
7
|
-
var
|
|
5
|
+
var se = (a, I, u) => I in a ? ce(a, I, { enumerable: !0, configurable: !0, writable: !0, value: u }) : a[I] = u;
|
|
6
|
+
var Z = (a, I, u) => se(a, typeof I != "symbol" ? I + "" : I, u), re = (a, I, u) => I.has(a) || oe("Cannot " + u);
|
|
7
|
+
var J = (a, I, u) => (re(a, I, "read from private field"), u ? u.call(a) : I.get(a)), st = (a, I, u) => I.has(a) ? oe("Cannot add the same private member more than once") : I instanceof WeakSet ? I.add(a) : I.set(a, u), St = (a, I, u, E) => (re(a, I, "write to private field"), E ? E.call(a, u) : I.set(a, u), u);
|
|
8
8
|
const L = (a, I = []) => {
|
|
9
9
|
const u = { ...a }, E = Object.keys(u);
|
|
10
10
|
for (const _ of E)
|
|
@@ -83,7 +83,7 @@ const L = (a, I = []) => {
|
|
|
83
83
|
}, G = (a) => W(a), U = (a, I = "YYYY-MM-DD hh:mm:ss", u = {}) => {
|
|
84
84
|
const E = { empty_str: "-", ...u }, { empty_str: _, offset: k } = E, e = W(a, k);
|
|
85
85
|
if (Number(a) !== 0 && e === 0) return _;
|
|
86
|
-
const n = new Date(e), O = `${n.getFullYear()}`, $ = `${n.getMonth() + 1}`, N = `${n.getDate()}`, D = `${n.getDay() === 0 ? 7 : n.getDay()}`, q = `${n.getHours()}`, P = `${n.getMinutes()}`, j = `${n.getSeconds()}`, V = `${Math.ceil((e - G(`${O}/01/01 00:00:00`) + 1) / 864e5)}`,
|
|
86
|
+
const n = new Date(e), O = `${n.getFullYear()}`, $ = `${n.getMonth() + 1}`, N = `${n.getDate()}`, D = `${n.getDay() === 0 ? 7 : n.getDay()}`, q = `${n.getHours()}`, P = `${n.getMinutes()}`, j = `${n.getSeconds()}`, V = `${Math.ceil((e - G(`${O}/01/01 00:00:00`) + 1) / 864e5)}`, Q = `${Math.ceil(((e - G(`${O}/01/01 00:00:00`)) / 864e5 - Number(D)) / 7) + 1}`, z = [
|
|
87
87
|
{ k: "Y+", v: O },
|
|
88
88
|
// 年
|
|
89
89
|
{ k: "M+", v: $ },
|
|
@@ -100,7 +100,7 @@ const L = (a, I = []) => {
|
|
|
100
100
|
// 秒
|
|
101
101
|
{ k: "d+", v: V },
|
|
102
102
|
// 第几天
|
|
103
|
-
{ k: "w+", v:
|
|
103
|
+
{ k: "w+", v: Q }
|
|
104
104
|
// 第几周
|
|
105
105
|
// 有其他格式化字符需求可以继续添加,必须转化成字符串
|
|
106
106
|
];
|
|
@@ -1141,15 +1141,15 @@ function requireFloat() {
|
|
|
1141
1141
|
if (D < 22250738585072014e-324)
|
|
1142
1142
|
V = D / 5e-324, O(V >>> 0, q, P + $), O((j << 31 | V / 4294967296) >>> 0, q, P + N);
|
|
1143
1143
|
else {
|
|
1144
|
-
var
|
|
1145
|
-
|
|
1144
|
+
var Q = Math.floor(Math.log(D) / Math.LN2);
|
|
1145
|
+
Q === 1024 && (Q = 1023), V = D * Math.pow(2, -Q), O(V * 4503599627370496 >>> 0, q, P + $), O((j << 31 | Q + 1023 << 20 | V * 1048576 & 1048575) >>> 0, q, P + N);
|
|
1146
1146
|
}
|
|
1147
1147
|
}
|
|
1148
1148
|
}
|
|
1149
1149
|
k.writeDoubleLE = e.bind(null, I, 0, 4), k.writeDoubleBE = e.bind(null, u, 4, 0);
|
|
1150
1150
|
function n(O, $, N, D, q) {
|
|
1151
|
-
var P = O(D, q + $), j = O(D, q + N), V = (j >> 31) * 2 + 1,
|
|
1152
|
-
return
|
|
1151
|
+
var P = O(D, q + $), j = O(D, q + N), V = (j >> 31) * 2 + 1, Q = j >>> 20 & 2047, z = 4294967296 * (j & 1048575) + P;
|
|
1152
|
+
return Q === 2047 ? z ? NaN : V * (1 / 0) : Q === 0 ? V * 5e-324 * z : V * Math.pow(2, Q - 1075) * (z + 4503599627370496);
|
|
1153
1153
|
}
|
|
1154
1154
|
k.readDoubleLE = n.bind(null, E, 0, 4), k.readDoubleBE = n.bind(null, _, 4, 0);
|
|
1155
1155
|
}(), k;
|
|
@@ -1422,13 +1422,13 @@ function requireWriter() {
|
|
|
1422
1422
|
if (hasRequiredWriter) return writer;
|
|
1423
1423
|
hasRequiredWriter = 1, writer = O;
|
|
1424
1424
|
var a = requireMinimal$1(), I, u = a.LongBits, E = a.base64, _ = a.utf8;
|
|
1425
|
-
function k(
|
|
1426
|
-
this.fn =
|
|
1425
|
+
function k(Q, z, Y) {
|
|
1426
|
+
this.fn = Q, this.len = z, this.next = void 0, this.val = Y;
|
|
1427
1427
|
}
|
|
1428
1428
|
function e() {
|
|
1429
1429
|
}
|
|
1430
|
-
function n(
|
|
1431
|
-
this.head =
|
|
1430
|
+
function n(Q) {
|
|
1431
|
+
this.head = Q.head, this.tail = Q.tail, this.len = Q.len, this.next = Q.states;
|
|
1432
1432
|
}
|
|
1433
1433
|
function O() {
|
|
1434
1434
|
this.len = 0, this.head = new k(e, 0, 0), this.tail = this.head, this.states = null;
|
|
@@ -1447,16 +1447,16 @@ function requireWriter() {
|
|
|
1447
1447
|
}, a.Array !== Array && (O.alloc = a.pool(O.alloc, a.Array.prototype.subarray)), O.prototype._push = function(z, Y, et) {
|
|
1448
1448
|
return this.tail = this.tail.next = new k(z, Y, et), this.len += Y, this;
|
|
1449
1449
|
};
|
|
1450
|
-
function N(
|
|
1451
|
-
z[Y] =
|
|
1450
|
+
function N(Q, z, Y) {
|
|
1451
|
+
z[Y] = Q & 255;
|
|
1452
1452
|
}
|
|
1453
|
-
function D(
|
|
1454
|
-
for (;
|
|
1455
|
-
z[Y++] =
|
|
1456
|
-
z[Y] =
|
|
1453
|
+
function D(Q, z, Y) {
|
|
1454
|
+
for (; Q > 127; )
|
|
1455
|
+
z[Y++] = Q & 127 | 128, Q >>>= 7;
|
|
1456
|
+
z[Y] = Q;
|
|
1457
1457
|
}
|
|
1458
|
-
function q(
|
|
1459
|
-
this.len =
|
|
1458
|
+
function q(Q, z) {
|
|
1459
|
+
this.len = Q, this.next = void 0, this.val = z;
|
|
1460
1460
|
}
|
|
1461
1461
|
q.prototype = Object.create(k.prototype), q.prototype.fn = D, O.prototype.uint32 = function(z) {
|
|
1462
1462
|
return this.len += (this.tail = this.tail.next = new q(
|
|
@@ -1468,12 +1468,12 @@ function requireWriter() {
|
|
|
1468
1468
|
}, O.prototype.sint32 = function(z) {
|
|
1469
1469
|
return this.uint32((z << 1 ^ z >> 31) >>> 0);
|
|
1470
1470
|
};
|
|
1471
|
-
function P(
|
|
1472
|
-
for (;
|
|
1473
|
-
z[Y++] =
|
|
1474
|
-
for (;
|
|
1475
|
-
z[Y++] =
|
|
1476
|
-
z[Y++] =
|
|
1471
|
+
function P(Q, z, Y) {
|
|
1472
|
+
for (; Q.hi; )
|
|
1473
|
+
z[Y++] = Q.lo & 127 | 128, Q.lo = (Q.lo >>> 7 | Q.hi << 25) >>> 0, Q.hi >>>= 7;
|
|
1474
|
+
for (; Q.lo > 127; )
|
|
1475
|
+
z[Y++] = Q.lo & 127 | 128, Q.lo = Q.lo >>> 7;
|
|
1476
|
+
z[Y++] = Q.lo;
|
|
1477
1477
|
}
|
|
1478
1478
|
O.prototype.uint64 = function(z) {
|
|
1479
1479
|
var Y = u.from(z);
|
|
@@ -1484,8 +1484,8 @@ function requireWriter() {
|
|
|
1484
1484
|
}, O.prototype.bool = function(z) {
|
|
1485
1485
|
return this._push(N, 1, z ? 1 : 0);
|
|
1486
1486
|
};
|
|
1487
|
-
function j(
|
|
1488
|
-
z[Y] =
|
|
1487
|
+
function j(Q, z, Y) {
|
|
1488
|
+
z[Y] = Q & 255, z[Y + 1] = Q >>> 8 & 255, z[Y + 2] = Q >>> 16 & 255, z[Y + 3] = Q >>> 24;
|
|
1489
1489
|
}
|
|
1490
1490
|
O.prototype.fixed32 = function(z) {
|
|
1491
1491
|
return this._push(j, 4, z >>> 0);
|
|
@@ -1526,8 +1526,8 @@ function requireWriter() {
|
|
|
1526
1526
|
for (var z = this.head.next, Y = this.constructor.alloc(this.len), et = 0; z; )
|
|
1527
1527
|
z.fn(z.val, Y, et), et += z.len, z = z.next;
|
|
1528
1528
|
return Y;
|
|
1529
|
-
}, O._configure = function(
|
|
1530
|
-
I =
|
|
1529
|
+
}, O._configure = function(Q) {
|
|
1530
|
+
I = Q, O.create = $(), I._configure();
|
|
1531
1531
|
}, writer;
|
|
1532
1532
|
}
|
|
1533
1533
|
var writer_buffer, hasRequiredWriter_buffer;
|
|
@@ -6157,9 +6157,9 @@ var Deflate_1$1 = Deflate$1, deflate_2 = deflate$1, deflateRaw_1$1 = deflateRaw$
|
|
|
6157
6157
|
};
|
|
6158
6158
|
const BAD$1 = 16209, TYPE$1 = 16191;
|
|
6159
6159
|
var inffast = function a(I, u) {
|
|
6160
|
-
let E, _, k, e, n, O, $, N, D, q, P, j, V,
|
|
6160
|
+
let E, _, k, e, n, O, $, N, D, q, P, j, V, Q, z, Y, et, tt, nt, lt, it, at, ct, ot;
|
|
6161
6161
|
const rt = I.state;
|
|
6162
|
-
E = I.next_in, ct = I.input, _ = E + (I.avail_in - 5), k = I.next_out, ot = I.output, e = k - (u - I.avail_out), n = k + (I.avail_out - 257), O = rt.dmax, $ = rt.wsize, N = rt.whave, D = rt.wnext, q = rt.window, P = rt.hold, j = rt.bits, V = rt.lencode,
|
|
6162
|
+
E = I.next_in, ct = I.input, _ = E + (I.avail_in - 5), k = I.next_out, ot = I.output, e = k - (u - I.avail_out), n = k + (I.avail_out - 257), O = rt.dmax, $ = rt.wsize, N = rt.whave, D = rt.wnext, q = rt.window, P = rt.hold, j = rt.bits, V = rt.lencode, Q = rt.distcode, z = (1 << rt.lenbits) - 1, Y = (1 << rt.distbits) - 1;
|
|
6163
6163
|
t:
|
|
6164
6164
|
do {
|
|
6165
6165
|
j < 15 && (P += ct[E++] << j, j += 8, P += ct[E++] << j, j += 8), et = V[P & z];
|
|
@@ -6168,7 +6168,7 @@ var inffast = function a(I, u) {
|
|
|
6168
6168
|
if (tt = et >>> 24, P >>>= tt, j -= tt, tt = et >>> 16 & 255, tt === 0)
|
|
6169
6169
|
ot[k++] = et & 65535;
|
|
6170
6170
|
else if (tt & 16) {
|
|
6171
|
-
nt = et & 65535, tt &= 15, tt && (j < tt && (P += ct[E++] << j, j += 8), nt += P & (1 << tt) - 1, P >>>= tt, j -= tt), j < 15 && (P += ct[E++] << j, j += 8, P += ct[E++] << j, j += 8), et =
|
|
6171
|
+
nt = et & 65535, tt &= 15, tt && (j < tt && (P += ct[E++] << j, j += 8), nt += P & (1 << tt) - 1, P >>>= tt, j -= tt), j < 15 && (P += ct[E++] << j, j += 8, P += ct[E++] << j, j += 8), et = Q[P & Y];
|
|
6172
6172
|
i:
|
|
6173
6173
|
for (; ; ) {
|
|
6174
6174
|
if (tt = et >>> 24, P >>>= tt, j -= tt, tt = et >>> 16 & 255, tt & 16) {
|
|
@@ -6181,13 +6181,13 @@ var inffast = function a(I, u) {
|
|
|
6181
6181
|
I.msg = "invalid distance too far back", rt.mode = BAD$1;
|
|
6182
6182
|
break t;
|
|
6183
6183
|
}
|
|
6184
|
-
if (it = 0,
|
|
6184
|
+
if (it = 0, at = q, D === 0) {
|
|
6185
6185
|
if (it += $ - tt, tt < nt) {
|
|
6186
6186
|
nt -= tt;
|
|
6187
6187
|
do
|
|
6188
6188
|
ot[k++] = q[it++];
|
|
6189
6189
|
while (--tt);
|
|
6190
|
-
it = k - lt,
|
|
6190
|
+
it = k - lt, at = ot;
|
|
6191
6191
|
}
|
|
6192
6192
|
} else if (D < tt) {
|
|
6193
6193
|
if (it += $ + D - tt, tt -= D, tt < nt) {
|
|
@@ -6200,7 +6200,7 @@ var inffast = function a(I, u) {
|
|
|
6200
6200
|
do
|
|
6201
6201
|
ot[k++] = q[it++];
|
|
6202
6202
|
while (--tt);
|
|
6203
|
-
it = k - lt,
|
|
6203
|
+
it = k - lt, at = ot;
|
|
6204
6204
|
}
|
|
6205
6205
|
}
|
|
6206
6206
|
} else if (it += D - tt, tt < nt) {
|
|
@@ -6208,11 +6208,11 @@ var inffast = function a(I, u) {
|
|
|
6208
6208
|
do
|
|
6209
6209
|
ot[k++] = q[it++];
|
|
6210
6210
|
while (--tt);
|
|
6211
|
-
it = k - lt,
|
|
6211
|
+
it = k - lt, at = ot;
|
|
6212
6212
|
}
|
|
6213
6213
|
for (; nt > 2; )
|
|
6214
|
-
ot[k++] =
|
|
6215
|
-
nt && (ot[k++] =
|
|
6214
|
+
ot[k++] = at[it++], ot[k++] = at[it++], ot[k++] = at[it++], nt -= 3;
|
|
6215
|
+
nt && (ot[k++] = at[it++], nt > 1 && (ot[k++] = at[it++]));
|
|
6216
6216
|
} else {
|
|
6217
6217
|
it = k - lt;
|
|
6218
6218
|
do
|
|
@@ -6221,7 +6221,7 @@ var inffast = function a(I, u) {
|
|
|
6221
6221
|
nt && (ot[k++] = ot[it++], nt > 1 && (ot[k++] = ot[it++]));
|
|
6222
6222
|
}
|
|
6223
6223
|
} else if ((tt & 64) === 0) {
|
|
6224
|
-
et =
|
|
6224
|
+
et = Q[(et & 65535) + (P & (1 << tt) - 1)];
|
|
6225
6225
|
continue i;
|
|
6226
6226
|
} else {
|
|
6227
6227
|
I.msg = "invalid distance code", rt.mode = BAD$1;
|
|
@@ -6380,9 +6380,9 @@ const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS
|
|
|
6380
6380
|
64
|
|
6381
6381
|
]), inflate_table = (a, I, u, E, _, k, e, n) => {
|
|
6382
6382
|
const O = n.bits;
|
|
6383
|
-
let $ = 0, N = 0, D = 0, q = 0, P = 0, j = 0, V = 0,
|
|
6383
|
+
let $ = 0, N = 0, D = 0, q = 0, P = 0, j = 0, V = 0, Q = 0, z = 0, Y = 0, et, tt, nt, lt, it, at = null, ct;
|
|
6384
6384
|
const ot = new Uint16Array(MAXBITS + 1), rt = new Uint16Array(MAXBITS + 1);
|
|
6385
|
-
let
|
|
6385
|
+
let gt = null, ne, Ct, Ut;
|
|
6386
6386
|
for ($ = 0; $ <= MAXBITS; $++)
|
|
6387
6387
|
ot[$] = 0;
|
|
6388
6388
|
for (N = 0; N < E; N++)
|
|
@@ -6393,21 +6393,21 @@ const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS
|
|
|
6393
6393
|
return _[k++] = 1 << 24 | 64 << 16 | 0, _[k++] = 1 << 24 | 64 << 16 | 0, n.bits = 1, 0;
|
|
6394
6394
|
for (D = 1; D < q && ot[D] === 0; D++)
|
|
6395
6395
|
;
|
|
6396
|
-
for (P < D && (P = D),
|
|
6397
|
-
if (
|
|
6396
|
+
for (P < D && (P = D), Q = 1, $ = 1; $ <= MAXBITS; $++)
|
|
6397
|
+
if (Q <<= 1, Q -= ot[$], Q < 0)
|
|
6398
6398
|
return -1;
|
|
6399
|
-
if (
|
|
6399
|
+
if (Q > 0 && (a === CODES$1 || q !== 1))
|
|
6400
6400
|
return -1;
|
|
6401
6401
|
for (rt[1] = 0, $ = 1; $ < MAXBITS; $++)
|
|
6402
6402
|
rt[$ + 1] = rt[$] + ot[$];
|
|
6403
6403
|
for (N = 0; N < E; N++)
|
|
6404
6404
|
I[u + N] !== 0 && (e[rt[I[u + N]]++] = N);
|
|
6405
|
-
if (a === CODES$1 ? (
|
|
6405
|
+
if (a === CODES$1 ? (at = gt = e, ct = 20) : a === LENS$1 ? (at = lbase, gt = lext, ct = 257) : (at = dbase, gt = dext, ct = 0), Y = 0, N = 0, $ = D, it = k, j = P, V = 0, nt = -1, z = 1 << P, lt = z - 1, a === LENS$1 && z > ENOUGH_LENS$1 || a === DISTS$1 && z > ENOUGH_DISTS$1)
|
|
6406
6406
|
return 1;
|
|
6407
6407
|
for (; ; ) {
|
|
6408
|
-
|
|
6408
|
+
ne = $ - V, e[N] + 1 < ct ? (Ct = 0, Ut = e[N]) : e[N] >= ct ? (Ct = gt[e[N] - ct], Ut = at[e[N] - ct]) : (Ct = 96, Ut = 0), et = 1 << $ - V, tt = 1 << j, D = tt;
|
|
6409
6409
|
do
|
|
6410
|
-
tt -= et, _[it + (Y >> V) + tt] =
|
|
6410
|
+
tt -= et, _[it + (Y >> V) + tt] = ne << 24 | Ct << 16 | Ut | 0;
|
|
6411
6411
|
while (tt !== 0);
|
|
6412
6412
|
for (et = 1 << $ - 1; Y & et; )
|
|
6413
6413
|
et >>= 1;
|
|
@@ -6417,8 +6417,8 @@ const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS
|
|
|
6417
6417
|
$ = I[u + e[N]];
|
|
6418
6418
|
}
|
|
6419
6419
|
if ($ > P && (Y & lt) !== nt) {
|
|
6420
|
-
for (V === 0 && (V = P), it += D, j = $ - V,
|
|
6421
|
-
j++,
|
|
6420
|
+
for (V === 0 && (V = P), it += D, j = $ - V, Q = 1 << j; j + V < q && (Q -= ot[j + V], !(Q <= 0)); )
|
|
6421
|
+
j++, Q <<= 1;
|
|
6422
6422
|
if (z += 1 << j, a === LENS$1 && z > ENOUGH_LENS$1 || a === DISTS$1 && z > ENOUGH_DISTS$1)
|
|
6423
6423
|
return 1;
|
|
6424
6424
|
nt = Y & lt, _[nt] = P << 24 | j << 16 | it - k | 0;
|
|
@@ -6495,16 +6495,16 @@ const fixedtables = (a) => {
|
|
|
6495
6495
|
const k = a.state;
|
|
6496
6496
|
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
6497
|
}, inflate$2 = (a, I) => {
|
|
6498
|
-
let u, E, _, k, e, n, O, $, N, D, q, P, j, V,
|
|
6498
|
+
let u, E, _, k, e, n, O, $, N, D, q, P, j, V, Q = 0, z, Y, et, tt, nt, lt, it, at;
|
|
6499
6499
|
const ct = new Uint8Array(4);
|
|
6500
6500
|
let ot, rt;
|
|
6501
|
-
const
|
|
6501
|
+
const gt = (
|
|
6502
6502
|
/* permutation of code lengths */
|
|
6503
6503
|
new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
|
|
6504
6504
|
);
|
|
6505
6505
|
if (inflateStateCheck(a) || !a.output || !a.input && a.avail_in !== 0)
|
|
6506
6506
|
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,
|
|
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, at = Z_OK$1;
|
|
6508
6508
|
t:
|
|
6509
6509
|
for (; ; )
|
|
6510
6510
|
switch (u.mode) {
|
|
@@ -6724,11 +6724,11 @@ const fixedtables = (a) => {
|
|
|
6724
6724
|
break t;
|
|
6725
6725
|
n--, $ += E[k++] << N, N += 8;
|
|
6726
6726
|
}
|
|
6727
|
-
u.lens[
|
|
6727
|
+
u.lens[gt[u.have++]] = $ & 7, $ >>>= 3, N -= 3;
|
|
6728
6728
|
}
|
|
6729
6729
|
for (; u.have < 19; )
|
|
6730
|
-
u.lens[
|
|
6731
|
-
if (u.lencode = u.lendyn, u.lenbits = 7, ot = { bits: u.lenbits },
|
|
6730
|
+
u.lens[gt[u.have++]] = 0;
|
|
6731
|
+
if (u.lencode = u.lendyn, u.lenbits = 7, ot = { bits: u.lenbits }, at = inftrees(CODES, u.lens, 0, 19, u.lencode, 0, u.work, ot), u.lenbits = ot.bits, at) {
|
|
6732
6732
|
a.msg = "invalid code lengths set", u.mode = BAD;
|
|
6733
6733
|
break;
|
|
6734
6734
|
}
|
|
@@ -6736,7 +6736,7 @@ const fixedtables = (a) => {
|
|
|
6736
6736
|
/* falls through */
|
|
6737
6737
|
case CODELENS:
|
|
6738
6738
|
for (; u.have < u.nlen + u.ndist; ) {
|
|
6739
|
-
for (;
|
|
6739
|
+
for (; Q = u.lencode[$ & (1 << u.lenbits) - 1], z = Q >>> 24, Y = Q >>> 16 & 255, et = Q & 65535, !(z <= N); ) {
|
|
6740
6740
|
if (n === 0)
|
|
6741
6741
|
break t;
|
|
6742
6742
|
n--, $ += E[k++] << N, N += 8;
|
|
@@ -6784,11 +6784,11 @@ const fixedtables = (a) => {
|
|
|
6784
6784
|
a.msg = "invalid code -- missing end-of-block", u.mode = BAD;
|
|
6785
6785
|
break;
|
|
6786
6786
|
}
|
|
6787
|
-
if (u.lenbits = 9, ot = { bits: u.lenbits },
|
|
6787
|
+
if (u.lenbits = 9, ot = { bits: u.lenbits }, at = inftrees(LENS, u.lens, 0, u.nlen, u.lencode, 0, u.work, ot), u.lenbits = ot.bits, at) {
|
|
6788
6788
|
a.msg = "invalid literal/lengths set", u.mode = BAD;
|
|
6789
6789
|
break;
|
|
6790
6790
|
}
|
|
6791
|
-
if (u.distbits = 6, u.distcode = u.distdyn, ot = { bits: u.distbits },
|
|
6791
|
+
if (u.distbits = 6, u.distcode = u.distdyn, ot = { bits: u.distbits }, at = inftrees(DISTS, u.lens, u.nlen, u.ndist, u.distcode, 0, u.work, ot), u.distbits = ot.bits, at) {
|
|
6792
6792
|
a.msg = "invalid distances set", u.mode = BAD;
|
|
6793
6793
|
break;
|
|
6794
6794
|
}
|
|
@@ -6803,13 +6803,13 @@ const fixedtables = (a) => {
|
|
|
6803
6803
|
a.next_out = e, a.avail_out = O, a.next_in = k, a.avail_in = n, u.hold = $, u.bits = N, inffast(a, q), 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, u.mode === TYPE && (u.back = -1);
|
|
6804
6804
|
break;
|
|
6805
6805
|
}
|
|
6806
|
-
for (u.back = 0;
|
|
6806
|
+
for (u.back = 0; Q = u.lencode[$ & (1 << u.lenbits) - 1], z = Q >>> 24, Y = Q >>> 16 & 255, et = Q & 65535, !(z <= N); ) {
|
|
6807
6807
|
if (n === 0)
|
|
6808
6808
|
break t;
|
|
6809
6809
|
n--, $ += E[k++] << N, N += 8;
|
|
6810
6810
|
}
|
|
6811
6811
|
if (Y && (Y & 240) === 0) {
|
|
6812
|
-
for (tt = z, nt = Y, lt = et;
|
|
6812
|
+
for (tt = z, nt = Y, lt = et; Q = u.lencode[lt + (($ & (1 << tt + nt) - 1) >> tt)], z = Q >>> 24, Y = Q >>> 16 & 255, et = Q & 65535, !(tt + z <= N); ) {
|
|
6813
6813
|
if (n === 0)
|
|
6814
6814
|
break t;
|
|
6815
6815
|
n--, $ += E[k++] << N, N += 8;
|
|
@@ -6842,13 +6842,13 @@ const fixedtables = (a) => {
|
|
|
6842
6842
|
u.was = u.length, u.mode = DIST;
|
|
6843
6843
|
/* falls through */
|
|
6844
6844
|
case DIST:
|
|
6845
|
-
for (;
|
|
6845
|
+
for (; Q = u.distcode[$ & (1 << u.distbits) - 1], z = Q >>> 24, Y = Q >>> 16 & 255, et = Q & 65535, !(z <= N); ) {
|
|
6846
6846
|
if (n === 0)
|
|
6847
6847
|
break t;
|
|
6848
6848
|
n--, $ += E[k++] << N, N += 8;
|
|
6849
6849
|
}
|
|
6850
6850
|
if ((Y & 240) === 0) {
|
|
6851
|
-
for (tt = z, nt = Y, lt = et;
|
|
6851
|
+
for (tt = z, nt = Y, lt = et; Q = u.distcode[lt + (($ & (1 << tt + nt) - 1) >> tt)], z = Q >>> 24, Y = Q >>> 16 & 255, et = Q & 65535, !(tt + z <= N); ) {
|
|
6852
6852
|
if (n === 0)
|
|
6853
6853
|
break t;
|
|
6854
6854
|
n--, $ += E[k++] << N, N += 8;
|
|
@@ -6930,10 +6930,10 @@ const fixedtables = (a) => {
|
|
|
6930
6930
|
u.mode = DONE;
|
|
6931
6931
|
/* falls through */
|
|
6932
6932
|
case DONE:
|
|
6933
|
-
|
|
6933
|
+
at = Z_STREAM_END$1;
|
|
6934
6934
|
break t;
|
|
6935
6935
|
case BAD:
|
|
6936
|
-
|
|
6936
|
+
at = Z_DATA_ERROR$1;
|
|
6937
6937
|
break t;
|
|
6938
6938
|
case MEM:
|
|
6939
6939
|
return Z_MEM_ERROR$1;
|
|
@@ -6943,7 +6943,7 @@ const fixedtables = (a) => {
|
|
|
6943
6943
|
return Z_STREAM_ERROR$1;
|
|
6944
6944
|
}
|
|
6945
6945
|
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) &&
|
|
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) && at === Z_OK$1 && (at = Z_BUF_ERROR), at;
|
|
6947
6947
|
}, inflateEnd = (a) => {
|
|
6948
6948
|
if (inflateStateCheck(a))
|
|
6949
6949
|
return Z_STREAM_ERROR$1;
|
|
@@ -7177,12 +7177,12 @@ const noLogEvents = ["heartbeat", "onNetQuality", "networkQualityChange"], compr
|
|
|
7177
7177
|
}
|
|
7178
7178
|
return a;
|
|
7179
7179
|
};
|
|
7180
|
-
var vt, ut,
|
|
7180
|
+
var vt, ut, Et, _t, yt, Mt, Pt, Lt, Bt, xt, jt, Zt, Ft;
|
|
7181
7181
|
class CallsWebSocket {
|
|
7182
7182
|
// 状态
|
|
7183
7183
|
constructor(I) {
|
|
7184
|
-
|
|
7185
|
-
|
|
7184
|
+
st(this, vt);
|
|
7185
|
+
st(this, ut, {
|
|
7186
7186
|
url: "wss://demo.putplay.cc/websocket",
|
|
7187
7187
|
// 地址
|
|
7188
7188
|
debug: !1,
|
|
@@ -7191,10 +7191,10 @@ class CallsWebSocket {
|
|
|
7191
7191
|
// 最大重连次数
|
|
7192
7192
|
timeout: 30 * 1e3
|
|
7193
7193
|
});
|
|
7194
|
-
|
|
7194
|
+
st(this, Et, "");
|
|
7195
7195
|
// 缓存登录凭证
|
|
7196
|
-
|
|
7197
|
-
|
|
7196
|
+
st(this, _t, {});
|
|
7197
|
+
st(this, yt, {});
|
|
7198
7198
|
Z(this, "state", "closed");
|
|
7199
7199
|
// 外部 发送消息之前
|
|
7200
7200
|
Z(this, "sendMessageBefore", async () => {
|
|
@@ -7206,26 +7206,26 @@ class CallsWebSocket {
|
|
|
7206
7206
|
Z(this, "onReconnectStop", (I) => {
|
|
7207
7207
|
});
|
|
7208
7208
|
// 是否需要重连
|
|
7209
|
-
|
|
7209
|
+
st(this, Mt, (I) => {
|
|
7210
7210
|
let u = !0;
|
|
7211
7211
|
const { code: E = 1e3, reason: _ = "" } = I;
|
|
7212
7212
|
return E === 1e3 && (_ === "quit success!" || _ === "replace old connection!") && (u = !1), u;
|
|
7213
7213
|
});
|
|
7214
7214
|
// 重连成功
|
|
7215
|
-
|
|
7216
|
-
|
|
7215
|
+
st(this, Pt, async (I) => {
|
|
7216
|
+
J(this, ut).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: 重连成功", I), this.state = "connected", this.onReconnectSuccess(I);
|
|
7217
7217
|
});
|
|
7218
7218
|
// 重连停止
|
|
7219
|
-
|
|
7220
|
-
|
|
7219
|
+
st(this, Lt, async (I) => {
|
|
7220
|
+
J(this, ut).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
7221
|
});
|
|
7222
7222
|
// 自定义心跳规则
|
|
7223
|
-
|
|
7223
|
+
st(this, Bt, () => {
|
|
7224
7224
|
const I = { event: "heartbeat", sn: +`${F(1e5, 999999)}` };
|
|
7225
7225
|
return com.quick.voice.proto.CommonReq.encode(I).finish();
|
|
7226
7226
|
});
|
|
7227
7227
|
// 更新日志
|
|
7228
|
-
|
|
7228
|
+
st(this, xt, (I, u = {}) => {
|
|
7229
7229
|
try {
|
|
7230
7230
|
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
7231
|
let N = {};
|
|
@@ -7246,10 +7246,10 @@ class CallsWebSocket {
|
|
|
7246
7246
|
}
|
|
7247
7247
|
let P = "#quickvo.logs";
|
|
7248
7248
|
ignoreEvent.includes(_) && (P = "#quickvo.ignoreEvents");
|
|
7249
|
-
const j = { "#action": q, timeStr: $, event: _, data: N, time: E, ...O }, V = localStorage.getItem(P) || JSON.stringify([]),
|
|
7249
|
+
const j = { "#action": q, timeStr: $, event: _, data: N, time: E, ...O }, V = localStorage.getItem(P) || JSON.stringify([]), Q = JSON.parse(V);
|
|
7250
7250
|
let z = _ === "heartbeat";
|
|
7251
7251
|
const Y = [j];
|
|
7252
|
-
for (const et of
|
|
7252
|
+
for (const et of Q) {
|
|
7253
7253
|
const { event: tt } = et;
|
|
7254
7254
|
if (tt === "heartbeat") {
|
|
7255
7255
|
if (z) continue;
|
|
@@ -7264,24 +7264,24 @@ class CallsWebSocket {
|
|
|
7264
7264
|
}
|
|
7265
7265
|
});
|
|
7266
7266
|
// 创建事件
|
|
7267
|
-
|
|
7267
|
+
st(this, jt, (I, { resolve: u, reject: E }) => {
|
|
7268
7268
|
const { sn: _ } = I, k = () => {
|
|
7269
|
-
const n =
|
|
7270
|
-
clearTimeout(n.destructionTimer), delete
|
|
7269
|
+
const n = J(this, _t)[_];
|
|
7270
|
+
clearTimeout(n.destructionTimer), delete J(this, _t)[_];
|
|
7271
7271
|
}, e = setTimeout(() => {
|
|
7272
|
-
const n =
|
|
7272
|
+
const n = J(this, _t)[_];
|
|
7273
7273
|
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
|
-
},
|
|
7275
|
-
|
|
7274
|
+
}, J(this, ut).timeout);
|
|
7275
|
+
J(this, _t)[_] = { message: I, resolve: u, reject: E, destruction: k, destructionTimer: e };
|
|
7276
7276
|
});
|
|
7277
7277
|
// 获取事件
|
|
7278
|
-
|
|
7278
|
+
st(this, Zt, (I) => J(this, _t)[I]);
|
|
7279
7279
|
// 接收消息
|
|
7280
|
-
|
|
7280
|
+
st(this, Ft, async (I) => {
|
|
7281
7281
|
const u = new Uint8Array(I), E = com.quick.voice.proto.CommonRsp.decode(u), { sn: _, event: k } = E, e = onMessageFormat(E);
|
|
7282
|
-
if (
|
|
7282
|
+
if (J(this, ut).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, xt).call(this, "res", e)), notifyName_keys.includes(k))
|
|
7283
7283
|
return this.emitNotify(k, L(e, ["code", "data", "desc"]));
|
|
7284
|
-
const O =
|
|
7284
|
+
const O = J(this, Zt).call(this, _);
|
|
7285
7285
|
if (O) {
|
|
7286
7286
|
const { resolve: $ = (D) => {
|
|
7287
7287
|
}, destruction: N = () => {
|
|
@@ -7291,12 +7291,12 @@ class CallsWebSocket {
|
|
|
7291
7291
|
});
|
|
7292
7292
|
// 清除事件
|
|
7293
7293
|
Z(this, "clearEvents", (I = []) => {
|
|
7294
|
-
const u = Object.keys(
|
|
7294
|
+
const u = Object.keys(J(this, _t));
|
|
7295
7295
|
I.length === 0 && (I = u);
|
|
7296
7296
|
for (const E of u) {
|
|
7297
7297
|
if (!I.includes(E)) continue;
|
|
7298
|
-
const _ =
|
|
7299
|
-
clearTimeout(_.destructionTimer), delete
|
|
7298
|
+
const _ = J(this, _t)[E];
|
|
7299
|
+
clearTimeout(_.destructionTimer), delete J(this, _t)[E];
|
|
7300
7300
|
}
|
|
7301
7301
|
});
|
|
7302
7302
|
/**
|
|
@@ -7305,31 +7305,31 @@ class CallsWebSocket {
|
|
|
7305
7305
|
* @returns
|
|
7306
7306
|
*/
|
|
7307
7307
|
Z(this, "connect", async (I = "") => new Promise(async (u) => {
|
|
7308
|
-
I &&
|
|
7309
|
-
const E = `${
|
|
7310
|
-
|
|
7311
|
-
...
|
|
7308
|
+
I && St(this, Et, I), J(this, vt) && (await J(this, vt).close(), this.state = "closed");
|
|
7309
|
+
const E = `${J(this, ut).url}?s=${J(this, Et)}&t=${Date.now()}`;
|
|
7310
|
+
St(this, vt, new M({
|
|
7311
|
+
...J(this, ut),
|
|
7312
7312
|
url: E,
|
|
7313
7313
|
binaryType: "arraybuffer",
|
|
7314
|
-
onMessage:
|
|
7315
|
-
checkReconnect:
|
|
7316
|
-
getHeartbeatMsg:
|
|
7317
|
-
onReconnectSuccess:
|
|
7318
|
-
onReconnectStop:
|
|
7319
|
-
})), this.state = "connecting", await
|
|
7314
|
+
onMessage: J(this, Ft),
|
|
7315
|
+
checkReconnect: J(this, Mt),
|
|
7316
|
+
getHeartbeatMsg: J(this, Bt),
|
|
7317
|
+
onReconnectSuccess: J(this, Pt),
|
|
7318
|
+
onReconnectStop: J(this, Lt)
|
|
7319
|
+
})), this.state = "connecting", await J(this, vt).connect(), this.state = "connected", J(this, ut).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: 当前广播事件", J(this, yt)), u(J(this, vt));
|
|
7320
7320
|
}));
|
|
7321
7321
|
/**
|
|
7322
7322
|
* 关闭
|
|
7323
7323
|
*/
|
|
7324
7324
|
Z(this, "close", async () => {
|
|
7325
7325
|
var u;
|
|
7326
|
-
|
|
7327
|
-
const I = Object.keys(
|
|
7326
|
+
J(this, ut).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: cws is close.");
|
|
7327
|
+
const I = Object.keys(J(this, _t));
|
|
7328
7328
|
for (const E of I) {
|
|
7329
|
-
const { destructionTimer: _ } =
|
|
7329
|
+
const { destructionTimer: _ } = J(this, _t)[E];
|
|
7330
7330
|
clearTimeout(_);
|
|
7331
7331
|
}
|
|
7332
|
-
|
|
7332
|
+
St(this, _t, {}), await ((u = J(this, vt)) == null ? void 0 : u.close()), St(this, vt, void 0), this.state = "closed";
|
|
7333
7333
|
});
|
|
7334
7334
|
/**
|
|
7335
7335
|
* 发送消息
|
|
@@ -7342,14 +7342,14 @@ class CallsWebSocket {
|
|
|
7342
7342
|
event: k,
|
|
7343
7343
|
sn: +`${n}${F(1e3, 9999)}`,
|
|
7344
7344
|
time: n,
|
|
7345
|
-
valid:
|
|
7345
|
+
valid: J(this, ut).timeout,
|
|
7346
7346
|
version: 1,
|
|
7347
7347
|
compress: !1,
|
|
7348
7348
|
...e
|
|
7349
7349
|
});
|
|
7350
|
-
|
|
7350
|
+
J(this, ut).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, xt).call(this, "req", O)), u && J(this, jt).call(this, O, { resolve: E, reject: _ });
|
|
7351
7351
|
const $ = com.quick.voice.proto.CommonReq.encode(O).finish();
|
|
7352
|
-
(N =
|
|
7352
|
+
(N = J(this, vt)) == null || N.sendMessage($);
|
|
7353
7353
|
}));
|
|
7354
7354
|
/**
|
|
7355
7355
|
* 触发广播事件
|
|
@@ -7357,7 +7357,7 @@ class CallsWebSocket {
|
|
|
7357
7357
|
* @param result 事件响应值
|
|
7358
7358
|
*/
|
|
7359
7359
|
Z(this, "emitNotify", async (I, u) => {
|
|
7360
|
-
const E =
|
|
7360
|
+
const E = J(this, yt)[I] || [];
|
|
7361
7361
|
for (const _ of E) {
|
|
7362
7362
|
const { callback: k = async () => {
|
|
7363
7363
|
} } = _;
|
|
@@ -7372,8 +7372,8 @@ class CallsWebSocket {
|
|
|
7372
7372
|
*/
|
|
7373
7373
|
Z(this, "addNotify", (I, u = !1) => {
|
|
7374
7374
|
const { event: E, sn: _ = ht(32) } = I;
|
|
7375
|
-
|
|
7376
|
-
const k =
|
|
7375
|
+
J(this, yt)[E] || (J(this, yt)[E] = []);
|
|
7376
|
+
const k = J(this, yt)[E], e = k.findIndex((n) => n.sn === _);
|
|
7377
7377
|
return e !== -1 && k.splice(e, 1), u ? k.unshift(I) : k.push(I), _;
|
|
7378
7378
|
});
|
|
7379
7379
|
/**
|
|
@@ -7381,18 +7381,18 @@ class CallsWebSocket {
|
|
|
7381
7381
|
*/
|
|
7382
7382
|
Z(this, "removeNotify", (I = []) => {
|
|
7383
7383
|
if (I.length === 0)
|
|
7384
|
-
|
|
7384
|
+
St(this, yt, {});
|
|
7385
7385
|
else {
|
|
7386
|
-
const u = Object.keys(
|
|
7386
|
+
const u = Object.keys(J(this, yt));
|
|
7387
7387
|
for (const E of u)
|
|
7388
|
-
|
|
7388
|
+
J(this, yt)[E] = J(this, yt)[E].filter((_) => !I.includes(_.sn || ""));
|
|
7389
7389
|
}
|
|
7390
|
-
|
|
7390
|
+
J(this, ut).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: 移除广播事件", J(this, yt));
|
|
7391
7391
|
});
|
|
7392
|
-
|
|
7392
|
+
St(this, ut, { ...J(this, ut), ...I });
|
|
7393
7393
|
}
|
|
7394
7394
|
}
|
|
7395
|
-
vt = new WeakMap(), ut = new WeakMap(),
|
|
7395
|
+
vt = new WeakMap(), ut = new WeakMap(), Et = new WeakMap(), _t = new WeakMap(), yt = new WeakMap(), Mt = new WeakMap(), Pt = new WeakMap(), Lt = new WeakMap(), Bt = new WeakMap(), xt = new WeakMap(), jt = new WeakMap(), Zt = new WeakMap(), Ft = new WeakMap();
|
|
7396
7396
|
var y = Object.defineProperty, x = (a) => {
|
|
7397
7397
|
throw TypeError(a);
|
|
7398
7398
|
}, 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 +7448,7 @@ class K {
|
|
|
7448
7448
|
}
|
|
7449
7449
|
}
|
|
7450
7450
|
d = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap();
|
|
7451
|
-
var
|
|
7451
|
+
var Ht;
|
|
7452
7452
|
class RoomBase {
|
|
7453
7453
|
constructor(I) {
|
|
7454
7454
|
Z(this, "options", {
|
|
@@ -7499,14 +7499,10 @@ class RoomBase {
|
|
|
7499
7499
|
const { appid: E, userId: _, earlyId: k = "", logUrl: e } = this.options, n = "web";
|
|
7500
7500
|
{
|
|
7501
7501
|
const O = { origin: n, type: I, app_id: E, user_id: _, ins_id: k, comment: u }, $ = new URLSearchParams(O).toString(), N = `${e}/upload/log?${$}`;
|
|
7502
|
-
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: reportLogs",
|
|
7503
|
-
}
|
|
7504
|
-
{
|
|
7505
|
-
const O = localStorage.getItem("#quickvo.logs") || JSON.stringify([]), N = new TextEncoder().encode(O);
|
|
7506
|
-
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: reportLogs", N);
|
|
7502
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: reportLogs", { obj: O, url: N });
|
|
7507
7503
|
}
|
|
7508
7504
|
});
|
|
7509
|
-
|
|
7505
|
+
st(this, Ht, () => {
|
|
7510
7506
|
this.taskQueue.setCondition("createWs", !0), this.taskQueue.setCondition("createSession", !1), this.taskQueue.setCondition("ice", !1);
|
|
7511
7507
|
});
|
|
7512
7508
|
/**
|
|
@@ -7599,33 +7595,35 @@ class RoomBase {
|
|
|
7599
7595
|
* 处理为应用层数据
|
|
7600
7596
|
*/
|
|
7601
7597
|
Z(this, "usersFilter", (I) => ft(I, ["id", "isSelf", "joinTime", "tracks", "callAction", "callActionStr", "callActionMap", "network", "permissions", "isPublished", "updateStreams"]).sort((_, k) => _.id.localeCompare(k.id, "en")));
|
|
7602
|
-
this.setOptions(I), this.cwsIns = new CallsWebSocket({ ...I }),
|
|
7598
|
+
this.setOptions(I), this.cwsIns = new CallsWebSocket({ ...I }), J(this, Ht).call(this);
|
|
7603
7599
|
}
|
|
7604
7600
|
}
|
|
7605
|
-
|
|
7606
|
-
var
|
|
7601
|
+
Ht = new WeakMap();
|
|
7602
|
+
var Tt, kt, dt, bt, wt, zt, Jt, It, Wt;
|
|
7607
7603
|
class RoomMedias extends RoomBase {
|
|
7608
|
-
//
|
|
7604
|
+
// 本地流管理
|
|
7609
7605
|
constructor(u) {
|
|
7610
7606
|
super(u);
|
|
7611
|
-
|
|
7607
|
+
st(this, Tt, []);
|
|
7612
7608
|
// 可用媒体设备列表
|
|
7613
|
-
|
|
7609
|
+
st(this, kt, /* @__PURE__ */ new Map());
|
|
7614
7610
|
// 媒体流设备管理
|
|
7615
|
-
|
|
7611
|
+
st(this, dt, /* @__PURE__ */ new Map());
|
|
7616
7612
|
// 媒体轨道参数管理
|
|
7617
|
-
|
|
7613
|
+
st(this, bt, /* @__PURE__ */ new Map());
|
|
7614
|
+
// 媒体流上下文
|
|
7615
|
+
st(this, wt, []);
|
|
7618
7616
|
/**
|
|
7619
7617
|
* 初始化媒体参数
|
|
7620
7618
|
*/
|
|
7621
|
-
|
|
7622
|
-
|
|
7619
|
+
st(this, zt, () => {
|
|
7620
|
+
J(this, dt).set("microphoneCamera_audio", {}), J(this, dt).set("microphoneCamera_video", { width: { ideal: 1920 }, height: { ideal: 1080 }, frameRate: { min: 10, ideal: 30 } }), J(this, dt).set("screenSharing_video", { width: { ideal: 1920 }, height: { ideal: 1080 }, frameRate: { min: 10, ideal: 30 } }), J(this, dt).set("screenSharing_audio", {});
|
|
7623
7621
|
});
|
|
7624
7622
|
/**
|
|
7625
7623
|
* 初始化媒体设备类型
|
|
7626
7624
|
*/
|
|
7627
|
-
|
|
7628
|
-
|
|
7625
|
+
st(this, Jt, () => {
|
|
7626
|
+
J(this, kt).set("audioinput", "default"), J(this, kt).set("videoinput", "default"), J(this, kt).set("audiooutput", "default");
|
|
7629
7627
|
});
|
|
7630
7628
|
/**
|
|
7631
7629
|
* 房间所有用户所有媒体流变化
|
|
@@ -7650,14 +7648,14 @@ class RoomMedias extends RoomBase {
|
|
|
7650
7648
|
case "audio":
|
|
7651
7649
|
{
|
|
7652
7650
|
const $ = new AudioMediaContext(k);
|
|
7653
|
-
|
|
7651
|
+
J(this, bt).set(e, $);
|
|
7654
7652
|
}
|
|
7655
7653
|
break;
|
|
7656
7654
|
// 视频媒体处理
|
|
7657
7655
|
case "video":
|
|
7658
7656
|
{
|
|
7659
7657
|
const $ = new VideoMediaContext(k);
|
|
7660
|
-
|
|
7658
|
+
J(this, bt).set(e, $);
|
|
7661
7659
|
}
|
|
7662
7660
|
break;
|
|
7663
7661
|
}
|
|
@@ -7665,7 +7663,7 @@ class RoomMedias extends RoomBase {
|
|
|
7665
7663
|
const $ = this.getUserMediaStreamContext(u, E);
|
|
7666
7664
|
if ($ && $.kind === "audio")
|
|
7667
7665
|
try {
|
|
7668
|
-
const N =
|
|
7666
|
+
const N = J(this, kt).get("audiooutput");
|
|
7669
7667
|
(O = $.audioContext) == null || O.setSinkId(N);
|
|
7670
7668
|
} catch (N) {
|
|
7671
7669
|
console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: setSinkId is error", N);
|
|
@@ -7677,21 +7675,21 @@ class RoomMedias extends RoomBase {
|
|
|
7677
7675
|
*/
|
|
7678
7676
|
Z(this, "getUserMediaStreamContext", (u, E) => {
|
|
7679
7677
|
const _ = this.getUserMediaKey(u, E);
|
|
7680
|
-
return
|
|
7678
|
+
return J(this, bt).get(_);
|
|
7681
7679
|
});
|
|
7682
7680
|
/**
|
|
7683
7681
|
* 获取用户音频媒体流上下文
|
|
7684
7682
|
*/
|
|
7685
7683
|
Z(this, "getUserAudioMediaStreamContext", (u, E) => {
|
|
7686
7684
|
const _ = this.getUserMediaKey(u, E);
|
|
7687
|
-
return
|
|
7685
|
+
return J(this, bt).get(_);
|
|
7688
7686
|
});
|
|
7689
7687
|
/**
|
|
7690
7688
|
* 删除用户媒体流上下文
|
|
7691
7689
|
*/
|
|
7692
7690
|
Z(this, "removeUserMediaStreamContext", (u, E) => {
|
|
7693
|
-
const _ = this.getUserMediaKey(u, E), k =
|
|
7694
|
-
k == null || k.stop(),
|
|
7691
|
+
const _ = this.getUserMediaKey(u, E), k = J(this, bt).get(_);
|
|
7692
|
+
k == null || k.stop(), J(this, bt).delete(_);
|
|
7695
7693
|
});
|
|
7696
7694
|
/**
|
|
7697
7695
|
* 获取某个用户的某个数据流
|
|
@@ -7724,16 +7722,16 @@ class RoomMedias extends RoomBase {
|
|
|
7724
7722
|
* 清除所有媒体流使用
|
|
7725
7723
|
*/
|
|
7726
7724
|
Z(this, "clearUserStreams", () => {
|
|
7727
|
-
const u =
|
|
7725
|
+
const u = J(this, bt).values();
|
|
7728
7726
|
for (const E of u)
|
|
7729
7727
|
E.stop();
|
|
7730
|
-
|
|
7728
|
+
St(this, bt, /* @__PURE__ */ new Map());
|
|
7731
7729
|
});
|
|
7732
7730
|
/**
|
|
7733
7731
|
* 设置轨道媒体参数
|
|
7734
7732
|
*/
|
|
7735
7733
|
Z(this, "setMediaTrackConstraints", async (u, E) => {
|
|
7736
|
-
|
|
7734
|
+
J(this, dt).set(u, E);
|
|
7737
7735
|
const k = this.getUserStream(this.options.userId, u).getTracks();
|
|
7738
7736
|
if (k.length !== 0)
|
|
7739
7737
|
for (const e of k) {
|
|
@@ -7741,6 +7739,17 @@ class RoomMedias extends RoomBase {
|
|
|
7741
7739
|
await e.applyConstraints(O);
|
|
7742
7740
|
}
|
|
7743
7741
|
});
|
|
7742
|
+
/**
|
|
7743
|
+
* 清理所有本地流
|
|
7744
|
+
*/
|
|
7745
|
+
Z(this, "clearLocalStream", () => {
|
|
7746
|
+
for (const u of J(this, wt)) {
|
|
7747
|
+
const E = u.getTracks();
|
|
7748
|
+
for (const _ of E)
|
|
7749
|
+
_.stop();
|
|
7750
|
+
}
|
|
7751
|
+
St(this, wt, []);
|
|
7752
|
+
});
|
|
7744
7753
|
/**
|
|
7745
7754
|
* 初始化本地流
|
|
7746
7755
|
*/
|
|
@@ -7751,31 +7760,33 @@ class RoomMedias extends RoomBase {
|
|
|
7751
7760
|
case "microphoneCamera_audio":
|
|
7752
7761
|
{
|
|
7753
7762
|
this.removeUserMediaStreamContext(E, "microphoneCamera_audio");
|
|
7754
|
-
const _ =
|
|
7755
|
-
await this.initUserMediaStreamContext(E, "microphoneCamera_audio", e);
|
|
7763
|
+
const _ = J(this, kt).get("audioinput"), k = J(this, dt).get("microphoneCamera_audio"), e = await navigator.mediaDevices.getUserMedia({ audio: { deviceId: _, ...k }, video: !1 });
|
|
7764
|
+
J(this, wt).push(e), await this.initUserMediaStreamContext(E, "microphoneCamera_audio", e);
|
|
7756
7765
|
}
|
|
7757
7766
|
break;
|
|
7758
7767
|
// 摄像头
|
|
7759
7768
|
case "microphoneCamera_video":
|
|
7760
7769
|
{
|
|
7761
7770
|
this.removeUserMediaStreamContext(E, "microphoneCamera_video");
|
|
7762
|
-
const _ =
|
|
7763
|
-
await this.initUserMediaStreamContext(E, "microphoneCamera_video", e);
|
|
7771
|
+
const _ = J(this, kt).get("videoinput"), k = J(this, dt).get("microphoneCamera_video"), e = await navigator.mediaDevices.getUserMedia({ audio: !1, video: { deviceId: _, ...k } });
|
|
7772
|
+
J(this, wt).push(e), await this.initUserMediaStreamContext(E, "microphoneCamera_video", e);
|
|
7764
7773
|
}
|
|
7765
7774
|
break;
|
|
7766
7775
|
// 麦克风 + 摄像头
|
|
7767
7776
|
case "microphoneCamera":
|
|
7768
7777
|
{
|
|
7769
7778
|
this.removeUserMediaStreamContext(E, "microphoneCamera_audio"), this.removeUserMediaStreamContext(E, "microphoneCamera_video");
|
|
7770
|
-
const _ =
|
|
7771
|
-
await this.initUserMediaStreamContext(E, "microphoneCamera_audio", O);
|
|
7779
|
+
const _ = J(this, kt).get("audioinput"), k = J(this, kt).get("videoinput"), e = J(this, dt).get("microphoneCamera_audio"), n = J(this, dt).get("microphoneCamera_video"), O = await navigator.mediaDevices.getUserMedia({ audio: { deviceId: _, ...e }, video: { deviceId: k, ...n } });
|
|
7780
|
+
J(this, wt).push(O), await this.initUserMediaStreamContext(E, "microphoneCamera_audio", O);
|
|
7772
7781
|
}
|
|
7773
7782
|
break;
|
|
7774
7783
|
// 屏幕共享 音频
|
|
7775
7784
|
case "screenSharing_audio":
|
|
7776
7785
|
{
|
|
7777
7786
|
this.removeUserMediaStreamContext(E, "screenSharing_audio");
|
|
7778
|
-
const _ =
|
|
7787
|
+
const _ = J(this, dt).get("screenSharing_audio"), k = await navigator.mediaDevices.getDisplayMedia({ audio: !0, video: !0, ..._ });
|
|
7788
|
+
J(this, wt).push(k);
|
|
7789
|
+
const e = k.getTracks();
|
|
7779
7790
|
for (const n of e) {
|
|
7780
7791
|
const { kind: O } = n;
|
|
7781
7792
|
if (O === "audio") {
|
|
@@ -7789,7 +7800,9 @@ class RoomMedias extends RoomBase {
|
|
|
7789
7800
|
case "screenSharing_video":
|
|
7790
7801
|
{
|
|
7791
7802
|
this.removeUserMediaStreamContext(E, u);
|
|
7792
|
-
const _ =
|
|
7803
|
+
const _ = J(this, dt).get(u), k = await navigator.mediaDevices.getDisplayMedia({ audio: !1, video: !0, ..._ });
|
|
7804
|
+
J(this, wt).push(k);
|
|
7805
|
+
const e = k.getTracks();
|
|
7793
7806
|
for (const n of e) {
|
|
7794
7807
|
const { kind: O } = n;
|
|
7795
7808
|
if (O === "video") {
|
|
@@ -7803,7 +7816,9 @@ class RoomMedias extends RoomBase {
|
|
|
7803
7816
|
case "screenSharing":
|
|
7804
7817
|
{
|
|
7805
7818
|
this.removeUserMediaStreamContext(E, "screenSharing_audio"), this.removeUserMediaStreamContext(E, "screenSharing_video");
|
|
7806
|
-
const _ =
|
|
7819
|
+
const _ = J(this, dt).get("screenSharing_audio"), k = J(this, dt).get("screenSharing_video"), e = await navigator.mediaDevices.getDisplayMedia({ audio: !0, video: !0, ..._, ...k });
|
|
7820
|
+
J(this, wt).push(e);
|
|
7821
|
+
const n = e.getTracks();
|
|
7807
7822
|
for (const O of n) {
|
|
7808
7823
|
const { kind: $ } = O;
|
|
7809
7824
|
if ($ === "audio") {
|
|
@@ -7826,33 +7841,33 @@ class RoomMedias extends RoomBase {
|
|
|
7826
7841
|
/**
|
|
7827
7842
|
* 获取媒体设备列表
|
|
7828
7843
|
*/
|
|
7829
|
-
|
|
7830
|
-
|
|
7844
|
+
st(this, It, 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) => {
|
|
7845
|
+
St(this, Tt, u);
|
|
7831
7846
|
}).catch(function(u) {
|
|
7832
7847
|
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: getEnumerateDevices is err", u);
|
|
7833
|
-
}),
|
|
7848
|
+
}), J(this, Tt)));
|
|
7834
7849
|
/**
|
|
7835
7850
|
* 媒体设备发生变化
|
|
7836
7851
|
*/
|
|
7837
|
-
|
|
7852
|
+
st(this, Wt, () => {
|
|
7838
7853
|
navigator.mediaDevices && (navigator.mediaDevices.ondevicechange = async () => {
|
|
7839
|
-
await
|
|
7840
|
-
}),
|
|
7854
|
+
await J(this, It).call(this), this.cwsIns.emitNotify("onDevicechange", { code: 200, data: {}, desc: "device is change." });
|
|
7855
|
+
}), J(this, It).call(this);
|
|
7841
7856
|
});
|
|
7842
7857
|
/**
|
|
7843
7858
|
* 获取正在使用的媒体设备ID
|
|
7844
7859
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
7845
7860
|
* @returns deviceId 设备ID
|
|
7846
7861
|
*/
|
|
7847
|
-
Z(this, "getMediaDeviceKind", (u) =>
|
|
7862
|
+
Z(this, "getMediaDeviceKind", (u) => J(this, kt).get(u));
|
|
7848
7863
|
/**
|
|
7849
7864
|
* 设置正在使用的媒体设备
|
|
7850
7865
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
7851
7866
|
* @param deviceId 设备ID
|
|
7852
7867
|
*/
|
|
7853
7868
|
Z(this, "setDeviceKind", async (u, E) => {
|
|
7854
|
-
if (
|
|
7855
|
-
const _ =
|
|
7869
|
+
if (J(this, kt).set(u, E), u === "audiooutput") {
|
|
7870
|
+
const _ = J(this, bt).values();
|
|
7856
7871
|
for (const k of _)
|
|
7857
7872
|
if (k.kind === "audio" && "setSinkId" in HTMLMediaElement.prototype)
|
|
7858
7873
|
try {
|
|
@@ -7873,7 +7888,7 @@ class RoomMedias extends RoomBase {
|
|
|
7873
7888
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
7874
7889
|
* @returns MediaDeviceInfo[]
|
|
7875
7890
|
*/
|
|
7876
|
-
Z(this, "getEnumerateDevices", async (u) => (await
|
|
7891
|
+
Z(this, "getEnumerateDevices", async (u) => (await J(this, It).call(this), J(this, Tt).filter((_) => _.kind === u)));
|
|
7877
7892
|
/**
|
|
7878
7893
|
* 获取可用音频输入设备
|
|
7879
7894
|
* @returns MediaDeviceInfo[]
|
|
@@ -7889,10 +7904,10 @@ class RoomMedias extends RoomBase {
|
|
|
7889
7904
|
* @returns MediaDeviceInfo[]
|
|
7890
7905
|
*/
|
|
7891
7906
|
Z(this, "getEnumerateVideoinputDevices", () => this.getEnumerateDevices("videoinput"));
|
|
7892
|
-
|
|
7907
|
+
J(this, Wt).call(this), J(this, Jt).call(this), J(this, zt).call(this);
|
|
7893
7908
|
}
|
|
7894
7909
|
}
|
|
7895
|
-
|
|
7910
|
+
Tt = new WeakMap(), kt = new WeakMap(), dt = new WeakMap(), bt = new WeakMap(), wt = new WeakMap(), zt = new WeakMap(), Jt = new WeakMap(), It = new WeakMap(), Wt = new WeakMap();
|
|
7896
7911
|
class RoomUsers extends RoomMedias {
|
|
7897
7912
|
constructor(u) {
|
|
7898
7913
|
super(u);
|
|
@@ -8196,11 +8211,11 @@ const createMutedAudioStream = () => {
|
|
|
8196
8211
|
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;
|
|
8197
8212
|
}, 100), E.captureStream(u);
|
|
8198
8213
|
};
|
|
8199
|
-
var
|
|
8214
|
+
var Ot, Kt, Nt, Gt, Qt, Vt;
|
|
8200
8215
|
class RoomPeer extends RoomUsers {
|
|
8201
8216
|
constructor(u) {
|
|
8202
8217
|
super(u);
|
|
8203
|
-
|
|
8218
|
+
st(this, Ot, /* @__PURE__ */ new Map());
|
|
8204
8219
|
// 假媒体流 (创建轨道用)
|
|
8205
8220
|
Z(this, "getPeerStatsTimer", 0);
|
|
8206
8221
|
// 获取报告的定时器
|
|
@@ -8219,28 +8234,28 @@ class RoomPeer extends RoomUsers {
|
|
|
8219
8234
|
// 网络抖动
|
|
8220
8235
|
});
|
|
8221
8236
|
Z(this, "initPeer", () => {
|
|
8222
|
-
this.peerIns = new RTCPeerConnection({ bundlePolicy: "max-bundle" }), this.transceiverMap = /* @__PURE__ */ new Map(),
|
|
8237
|
+
this.peerIns = new RTCPeerConnection({ bundlePolicy: "max-bundle" }), this.transceiverMap = /* @__PURE__ */ new Map(), J(this, Gt).call(this), J(this, Vt).call(this);
|
|
8223
8238
|
});
|
|
8224
8239
|
// 初始化假数据流
|
|
8225
|
-
|
|
8240
|
+
st(this, Kt, () => {
|
|
8226
8241
|
for (const u of mediaType_keys)
|
|
8227
8242
|
switch (u) {
|
|
8228
8243
|
case "microphoneCamera_audio":
|
|
8229
|
-
|
|
8244
|
+
J(this, Ot).set("microphoneCamera_audio", createMutedAudioStream());
|
|
8230
8245
|
break;
|
|
8231
8246
|
case "microphoneCamera_video":
|
|
8232
|
-
|
|
8247
|
+
J(this, Ot).set("microphoneCamera_video", createFakeVideoStream());
|
|
8233
8248
|
break;
|
|
8234
8249
|
case "screenSharing_audio":
|
|
8235
|
-
|
|
8250
|
+
J(this, Ot).set("screenSharing_audio", createMutedAudioStream());
|
|
8236
8251
|
break;
|
|
8237
8252
|
case "screenSharing_video":
|
|
8238
|
-
|
|
8253
|
+
J(this, Ot).set("screenSharing_video", createFakeVideoStream());
|
|
8239
8254
|
break;
|
|
8240
8255
|
}
|
|
8241
8256
|
});
|
|
8242
8257
|
// 获取假数据流
|
|
8243
|
-
|
|
8258
|
+
st(this, Nt, (u) => J(this, Ot).get(u));
|
|
8244
8259
|
/**
|
|
8245
8260
|
* 替换发射器媒体流
|
|
8246
8261
|
*/
|
|
@@ -8252,7 +8267,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8252
8267
|
let n;
|
|
8253
8268
|
if (e) {
|
|
8254
8269
|
const { sender: O } = e;
|
|
8255
|
-
E ? n = this.getUserStream(_, k) : n =
|
|
8270
|
+
E ? n = this.getUserStream(_, k) : n = J(this, Nt).call(this, k);
|
|
8256
8271
|
const [$] = n.getTracks();
|
|
8257
8272
|
await O.replaceTrack($);
|
|
8258
8273
|
}
|
|
@@ -8281,7 +8296,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8281
8296
|
const E = [];
|
|
8282
8297
|
for (const _ of u) {
|
|
8283
8298
|
if (this.transceiverMap.has(_)) continue;
|
|
8284
|
-
const k =
|
|
8299
|
+
const k = J(this, Nt).call(this, _), [e] = k.getTracks(), n = this.peerIns.addTransceiver(e, { direction: "sendonly" });
|
|
8285
8300
|
this.transceiverMap.set(_, n), E.push(_);
|
|
8286
8301
|
}
|
|
8287
8302
|
if (u.length === 0 || E.length) {
|
|
@@ -8298,6 +8313,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8298
8313
|
* 移除发射器
|
|
8299
8314
|
*/
|
|
8300
8315
|
Z(this, "removeSenders", async (u = []) => {
|
|
8316
|
+
u.length === 0 && (u = mediaType_keys);
|
|
8301
8317
|
for (const E of u)
|
|
8302
8318
|
this.transceiverMap.has(E) && this.transceiverMap.delete(E);
|
|
8303
8319
|
});
|
|
@@ -8344,7 +8360,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8344
8360
|
}
|
|
8345
8361
|
await this.emitNotifyUpdateUsersStreams(N), this.peerIns.removeEventListener("track", O), _(!0);
|
|
8346
8362
|
}, O = async ($) => {
|
|
8347
|
-
const { streams: N, transceiver: D } = $, [q] = N, { mid: P, receiver: j } = D, { track: V } = j, { id:
|
|
8363
|
+
const { streams: N, transceiver: D } = $, [q] = N, { mid: P, receiver: j } = D, { track: V } = j, { id: Q, kind: z } = V, Y = k.find((nt) => nt.mid === `${P}`);
|
|
8348
8364
|
if (!Y) return;
|
|
8349
8365
|
const { userId: et, mediaType: tt } = Y;
|
|
8350
8366
|
if (!(!et || !tt)) {
|
|
@@ -8353,7 +8369,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8353
8369
|
(nt == null ? void 0 : nt.kind) === "audio" && nt.setMute(!1);
|
|
8354
8370
|
}
|
|
8355
8371
|
{
|
|
8356
|
-
const nt = { ...Y, mid: P, msid:
|
|
8372
|
+
const nt = { ...Y, mid: P, msid: Q };
|
|
8357
8373
|
e.push(nt);
|
|
8358
8374
|
}
|
|
8359
8375
|
this.options.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#00b60f;", `------->quickvo: await subscribe ${e.length}/${k.length}`, { mediaType: tt, mid: P, userTrack: Y, e: $ }), k.length === e.length && n();
|
|
@@ -8366,7 +8382,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8366
8382
|
/**
|
|
8367
8383
|
* 监听webrtc ice通讯连接
|
|
8368
8384
|
*/
|
|
8369
|
-
|
|
8385
|
+
st(this, Gt, () => {
|
|
8370
8386
|
let u = 0;
|
|
8371
8387
|
const E = () => {
|
|
8372
8388
|
this.setRoomState("closed");
|
|
@@ -8516,7 +8532,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8516
8532
|
/**
|
|
8517
8533
|
* 计算网络质量
|
|
8518
8534
|
*/
|
|
8519
|
-
|
|
8535
|
+
st(this, Qt, async () => {
|
|
8520
8536
|
try {
|
|
8521
8537
|
const u = await this.peerIns.getStats(), E = ["inbound-rtp", "remote-inbound-rtp", "outbound-rtp"], k = [...u.values()].filter((nt) => E.includes(nt.type));
|
|
8522
8538
|
let e = 0, n = 0, O = 0, $ = 0, N = 0, D = 0, q = [], P = [];
|
|
@@ -8526,23 +8542,23 @@ class RoomPeer extends RoomUsers {
|
|
|
8526
8542
|
}
|
|
8527
8543
|
this.reports = k;
|
|
8528
8544
|
for (const nt of this.reports) {
|
|
8529
|
-
const { bytesReceived: lt, bytesSent: it, packetsSent:
|
|
8530
|
-
lt && (e = lt), it && (n = it),
|
|
8545
|
+
const { bytesReceived: lt, bytesSent: it, packetsSent: at, packetsLost: ct, jitter: ot, roundTripTime: rt } = nt;
|
|
8546
|
+
lt && (e = lt), it && (n = it), at && (N += at), ct && (D += ct), rt && q.push((rt * 100).toFixed(2)), ot && P.push(ot.toFixed(2));
|
|
8531
8547
|
}
|
|
8532
8548
|
P.sort().reverse(), q.sort().reverse();
|
|
8533
|
-
const j = N - O, V = D - $,
|
|
8549
|
+
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 };
|
|
8534
8550
|
this.peerNetwork = et;
|
|
8535
8551
|
const tt = (nt, lt, it) => {
|
|
8536
|
-
const
|
|
8552
|
+
const at = Number(nt), ct = Number(lt), ot = Number(it);
|
|
8537
8553
|
let rt = "0";
|
|
8538
|
-
return
|
|
8554
|
+
return at < 0.03 && ct < 100 && ot < 0.05 ? rt = "5" : at < 0.06 && ct < 160 && ot < 0.1 ? rt = "4" : at < 0.1 && ct < 250 && ot < 0.15 ? rt = "3" : at < 0.15 && ct < 400 && ot < 0.2 ? rt = "2" : rt = "1", Number(rt);
|
|
8539
8555
|
};
|
|
8540
8556
|
{
|
|
8541
|
-
const nt = tt(
|
|
8542
|
-
if (await this.updateUserNetwork(this.options.userId,
|
|
8557
|
+
const nt = tt(Q, z, Y), lt = await this.getCaller(), { network: it } = lt, at = { egress: nt, ingress: nt }, ct = JSON.stringify(it) !== JSON.stringify(at);
|
|
8558
|
+
if (await this.updateUserNetwork(this.options.userId, at), ct) {
|
|
8543
8559
|
this.emitNotifyUpdateUsers();
|
|
8544
8560
|
const { userId: ot, roomId: rt } = this.options;
|
|
8545
|
-
this.cwsIns.sendMessage({ event: "networkQualityChange", data: { ...
|
|
8561
|
+
this.cwsIns.sendMessage({ event: "networkQualityChange", data: { ...at, userId: ot, roomId: rt } }, !1);
|
|
8546
8562
|
}
|
|
8547
8563
|
}
|
|
8548
8564
|
} catch (u) {
|
|
@@ -8552,9 +8568,9 @@ class RoomPeer extends RoomUsers {
|
|
|
8552
8568
|
/**
|
|
8553
8569
|
* 获取连接的所有轨道分析数据
|
|
8554
8570
|
*/
|
|
8555
|
-
|
|
8571
|
+
st(this, Vt, () => {
|
|
8556
8572
|
const u = async () => {
|
|
8557
|
-
this.peerIns.connectionState !== "connected" || !this.options.roomId ||
|
|
8573
|
+
this.peerIns.connectionState !== "connected" || !this.options.roomId || J(this, Qt).call(this);
|
|
8558
8574
|
};
|
|
8559
8575
|
this.getPeerStatsTimer = setInterval(u, 1 * 1e3);
|
|
8560
8576
|
});
|
|
@@ -8562,11 +8578,11 @@ class RoomPeer extends RoomUsers {
|
|
|
8562
8578
|
* 停止网络报告分析
|
|
8563
8579
|
*/
|
|
8564
8580
|
Z(this, "stopGetPeerStats", () => clearInterval(this.getPeerStatsTimer));
|
|
8565
|
-
|
|
8581
|
+
J(this, Kt).call(this);
|
|
8566
8582
|
}
|
|
8567
8583
|
}
|
|
8568
|
-
|
|
8569
|
-
var
|
|
8584
|
+
Ot = new WeakMap(), Kt = new WeakMap(), Nt = new WeakMap(), Gt = new WeakMap(), Qt = new WeakMap(), Vt = new WeakMap();
|
|
8585
|
+
var Yt, Rt, At, qt, Dt;
|
|
8570
8586
|
class RoomCalls extends RoomPeer {
|
|
8571
8587
|
constructor(u) {
|
|
8572
8588
|
super(u);
|
|
@@ -8576,7 +8592,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8576
8592
|
* 广播给房间其他人
|
|
8577
8593
|
* 只有当自己建立了发射轨道 并且 加入房间后才进行广播
|
|
8578
8594
|
*/
|
|
8579
|
-
|
|
8595
|
+
st(this, Yt, async (u) => {
|
|
8580
8596
|
const { roomId: E } = this.options;
|
|
8581
8597
|
if (!E) return;
|
|
8582
8598
|
const { id: _, tracks: k = [] } = await this.getCaller();
|
|
@@ -8587,7 +8603,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8587
8603
|
/**
|
|
8588
8604
|
* 更新自己通话状态
|
|
8589
8605
|
*/
|
|
8590
|
-
|
|
8606
|
+
st(this, Rt, async (u) => new Promise(async (E, _) => {
|
|
8591
8607
|
const { roomId: k, userId: e } = this.options, n = { roomId: k, user: { id: e, callAction: u } };
|
|
8592
8608
|
await this.cwsIns.sendMessage({ event: "updateCall", data: n }).then(async (O) => {
|
|
8593
8609
|
const { code: $ = 0 } = O;
|
|
@@ -8598,7 +8614,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8598
8614
|
/**
|
|
8599
8615
|
* 创建连接
|
|
8600
8616
|
*/
|
|
8601
|
-
|
|
8617
|
+
st(this, At, () => new Promise(async (u, E) => {
|
|
8602
8618
|
try {
|
|
8603
8619
|
if (["connecting", "connected"].includes(this.cwsIns.state)) return u(!0);
|
|
8604
8620
|
this.taskQueue.setCondition("createWs", !1), this.cwsIns.clearEvents(), this.initPeer();
|
|
@@ -8625,7 +8641,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8625
8641
|
/**
|
|
8626
8642
|
* 创建cf会话
|
|
8627
8643
|
*/
|
|
8628
|
-
|
|
8644
|
+
st(this, qt, () => {
|
|
8629
8645
|
if (!["connecting", "connected"].includes(this.roomState))
|
|
8630
8646
|
return this.setRoomState("connecting"), new Promise((u) => {
|
|
8631
8647
|
const E = async () => {
|
|
@@ -8661,12 +8677,12 @@ class RoomCalls extends RoomPeer {
|
|
|
8661
8677
|
* @example quickvo.earlyConnect(['microphoneCamera_audio', 'microphoneCamera_video'])
|
|
8662
8678
|
*/
|
|
8663
8679
|
Z(this, "earlyConnect", (u = []) => {
|
|
8664
|
-
this.isEarly = !0,
|
|
8680
|
+
this.isEarly = !0, J(this, At).call(this), J(this, qt).call(this), u.length === 0 && (u = ["microphoneCamera_audio", "microphoneCamera_video"]), J(this, Dt).call(this, u);
|
|
8665
8681
|
});
|
|
8666
8682
|
/**
|
|
8667
8683
|
* 创建媒体轨道
|
|
8668
8684
|
*/
|
|
8669
|
-
|
|
8685
|
+
st(this, Dt, async (u) => new Promise((E) => {
|
|
8670
8686
|
const _ = async () => {
|
|
8671
8687
|
try {
|
|
8672
8688
|
this.taskQueue.setCondition("createTrack", !1);
|
|
@@ -8683,8 +8699,8 @@ class RoomCalls extends RoomPeer {
|
|
|
8683
8699
|
const { remoteSdp: D } = N;
|
|
8684
8700
|
await this.setRemoteDescription({ type: "answer", sdp: D }), this.taskQueue.setCondition("createTrack", !0), E(!0);
|
|
8685
8701
|
});
|
|
8686
|
-
} catch {
|
|
8687
|
-
await this.removeSenders(u), this.taskQueue.setCondition("createTrack", !0), E(!0);
|
|
8702
|
+
} 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);
|
|
8688
8704
|
}
|
|
8689
8705
|
};
|
|
8690
8706
|
this.taskQueue.addTask(_, ["createWs", "createSession", "ice", "subscribe", "createTrack", "closeTrack"], { describe: "createTrack" });
|
|
@@ -8700,22 +8716,23 @@ class RoomCalls extends RoomPeer {
|
|
|
8700
8716
|
Z(this, "setLocalStream", (u, E) => new Promise(async (_, k) => {
|
|
8701
8717
|
try {
|
|
8702
8718
|
typeof u == "string" && (u = [u]);
|
|
8703
|
-
const { userId: e } = this.options;
|
|
8719
|
+
const { userId: e = "" } = this.options;
|
|
8704
8720
|
for (const O of u)
|
|
8705
8721
|
if (this.setLocalStreamActiveMap.set(O, E), E === !1) {
|
|
8706
8722
|
this.removeUserMediaStreamContext(e, O);
|
|
8707
8723
|
continue;
|
|
8708
8724
|
}
|
|
8709
|
-
if (E
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8725
|
+
if (E) {
|
|
8726
|
+
if (u.includes("microphoneCamera_audio") && u.includes("microphoneCamera_video") && await this.initLocalStream("microphoneCamera"), u.includes("microphoneCamera_audio") && await this.initLocalStream("microphoneCamera_audio"), u.includes("microphoneCamera_video") && await this.initLocalStream("microphoneCamera_video"), u.includes("screenSharing_audio") && u.includes("screenSharing_video") && await this.initLocalStream("screenSharing"), u.includes("screenSharing_audio") && !u.includes("screenSharing_video") && await this.initLocalStream("screenSharing_audio"), u.includes("screenSharing_video") && !u.includes("screenSharing_audio") && await this.initLocalStream("screenSharing_video"), u.includes("screenSharing_audio")) {
|
|
8727
|
+
const $ = this.getUserStream(e, "screenSharing_audio").getTracks();
|
|
8728
|
+
for (const N of $)
|
|
8729
|
+
N.onended = () => this.stopPublish(["screenSharing_audio"]);
|
|
8730
|
+
}
|
|
8731
|
+
if (u.includes("screenSharing_video")) {
|
|
8732
|
+
const $ = this.getUserStream(e, "screenSharing_video").getTracks();
|
|
8733
|
+
for (const N of $)
|
|
8734
|
+
N.onended = () => this.stopPublish(["screenSharing_video"]);
|
|
8735
|
+
}
|
|
8719
8736
|
}
|
|
8720
8737
|
const n = this.getUserStreams(e);
|
|
8721
8738
|
_(n);
|
|
@@ -8763,7 +8780,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8763
8780
|
* @example quickvo.joinRoom({ userId: '', roomId: '', sdkToken: '', callType: '1' , newPublishAutoSubscribe: true })
|
|
8764
8781
|
* @returns Promise<boolean>
|
|
8765
8782
|
*/
|
|
8766
|
-
Z(this, "joinRoom", async (u) => (this.setOptions(u), await
|
|
8783
|
+
Z(this, "joinRoom", async (u) => (this.setOptions(u), await J(this, At).call(this), new Promise((E, _) => {
|
|
8767
8784
|
this.clearUsers();
|
|
8768
8785
|
let k = "";
|
|
8769
8786
|
const e = async () => {
|
|
@@ -8780,9 +8797,9 @@ class RoomCalls extends RoomPeer {
|
|
|
8780
8797
|
}).then(async (D) => {
|
|
8781
8798
|
const { code: q = 0, desc: P = "服务器繁忙", data: j } = D;
|
|
8782
8799
|
if (q !== 200) return _(P);
|
|
8783
|
-
const { roomId: V = "", roomUsers:
|
|
8800
|
+
const { roomId: V = "", roomUsers: Q = [] } = j;
|
|
8784
8801
|
if (V !== O) return _("加入的房间不匹配");
|
|
8785
|
-
this.isInRoom = !0,
|
|
8802
|
+
this.isInRoom = !0, J(this, qt).call(this), await this.updateUsers(Q), e();
|
|
8786
8803
|
});
|
|
8787
8804
|
} catch (O) {
|
|
8788
8805
|
this.taskQueue.setCondition("joinRoom", !0), this.reportLogs("join_room_error", O.message || O), _(`加入房间失败: ${O.message || O || "服务器繁忙"}`);
|
|
@@ -8798,7 +8815,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8798
8815
|
Z(this, "quitRoom", () => new Promise(async (u) => {
|
|
8799
8816
|
const { roomId: E, userId: _ } = this.options, k = { roomId: E, user: { id: _ } };
|
|
8800
8817
|
try {
|
|
8801
|
-
this.isInRoom = !1, this.
|
|
8818
|
+
this.isInRoom = !1, this.clearLocalStream(), this.stopSubscribe(), this.stopGetPeerStats(), this.clearUsers(), this.clearUserStreams(), this.cwsIns.clearEvents(), this.setRoomState("ready");
|
|
8802
8819
|
} catch (e) {
|
|
8803
8820
|
this.reportLogs("quit_room_error", e.message || e);
|
|
8804
8821
|
}
|
|
@@ -8812,7 +8829,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8812
8829
|
Z(this, "quitRoomEx", () => new Promise(async (u) => {
|
|
8813
8830
|
const { roomId: E, userId: _ } = this.options, k = { roomId: E, user: { id: _ } };
|
|
8814
8831
|
try {
|
|
8815
|
-
this.isInRoom = !1, this.
|
|
8832
|
+
this.isInRoom = !1, this.clearLocalStream(), this.stopSubscribe(), this.stopGetPeerStats(), this.clearUsers(), this.clearUserStreams();
|
|
8816
8833
|
} catch (e) {
|
|
8817
8834
|
this.reportLogs("quit_room_error", e.message || e);
|
|
8818
8835
|
}
|
|
@@ -8847,7 +8864,6 @@ class RoomCalls extends RoomPeer {
|
|
|
8847
8864
|
const k = async () => {
|
|
8848
8865
|
try {
|
|
8849
8866
|
const e = await this.getCaller();
|
|
8850
|
-
await this.replaceSenderStream(u, !1);
|
|
8851
8867
|
try {
|
|
8852
8868
|
await this.setLocalStream(u, !0);
|
|
8853
8869
|
} catch {
|
|
@@ -8856,11 +8872,11 @@ class RoomCalls extends RoomPeer {
|
|
|
8856
8872
|
for (const q of u)
|
|
8857
8873
|
this.getUserStream(e.id, q).getTracks().length === 0 && n.push(q);
|
|
8858
8874
|
const O = u.filter((q) => !n.includes(q) || ["microphoneCamera_audio", "microphoneCamera_video"].includes(q));
|
|
8859
|
-
await
|
|
8875
|
+
await J(this, Dt).call(this, O);
|
|
8860
8876
|
const $ = await this.getSenderTracks(O), N = [...e.tracks, ...$];
|
|
8861
8877
|
await this.updateUsertracks(e.id, N, !0);
|
|
8862
8878
|
const D = await this.getCallAction(N);
|
|
8863
|
-
await
|
|
8879
|
+
await J(this, Rt).call(this, D), J(this, Yt).call(this, u), await this.replaceSenderStream(O, !0), n.length !== 0 && await this.inactiveTracks(n, !1);
|
|
8864
8880
|
{
|
|
8865
8881
|
await this.emitNotifyUpdateUsers();
|
|
8866
8882
|
const q = await this.getCaller();
|
|
@@ -8893,7 +8909,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8893
8909
|
await this.replaceSenderStream(u, !1), await this.closeUserTracks(e.id, n, !0), await this.removeSenders(u);
|
|
8894
8910
|
{
|
|
8895
8911
|
const $ = await this.getCallAction(e.tracks);
|
|
8896
|
-
await
|
|
8912
|
+
await J(this, Rt).call(this, $);
|
|
8897
8913
|
}
|
|
8898
8914
|
await this.createOffer(), await this.cwsIns.sendMessage({
|
|
8899
8915
|
event: "closeTrack",
|
|
@@ -8924,7 +8940,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8924
8940
|
for (const q of n) {
|
|
8925
8941
|
const { isSelf: P, tracks: j = [] } = q;
|
|
8926
8942
|
if (!P) {
|
|
8927
|
-
const V = j.filter(({ trackName:
|
|
8943
|
+
const V = j.filter(({ trackName: Q, mid: z = "" }) => z !== "" && (u.includes(Q) || u.length === 0));
|
|
8928
8944
|
V.length !== 0 && O.push({ ...q, tracks: V });
|
|
8929
8945
|
}
|
|
8930
8946
|
}
|
|
@@ -8935,8 +8951,8 @@ class RoomCalls extends RoomPeer {
|
|
|
8935
8951
|
if (O.length === 0) return $();
|
|
8936
8952
|
const N = [];
|
|
8937
8953
|
for (const q of O) {
|
|
8938
|
-
const { id: P, tracks: j } = q, V = ft(j, ["type", "trackName"]),
|
|
8939
|
-
N.push(
|
|
8954
|
+
const { id: P, tracks: j } = q, V = ft(j, ["type", "trackName"]), Q = { id: P, tracks: V };
|
|
8955
|
+
N.push(Q);
|
|
8940
8956
|
}
|
|
8941
8957
|
const D = async () => {
|
|
8942
8958
|
this.options.debug && console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", `------->quickvo: surplus subscribe count is ${E}`), await this.cwsIns.sendMessage({
|
|
@@ -8949,10 +8965,10 @@ class RoomCalls extends RoomPeer {
|
|
|
8949
8965
|
return await new Promise((Y) => setTimeout(() => Y(!0), 300)), E = E - 1, D();
|
|
8950
8966
|
throw this.options.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: subscribe is error. count 0", { trackNames: u }), new Error(V);
|
|
8951
8967
|
}
|
|
8952
|
-
const { remoteSdp:
|
|
8968
|
+
const { remoteSdp: Q, users: z = [] } = j;
|
|
8953
8969
|
this.onSubscribeUserTracks(z).then(async () => {
|
|
8954
8970
|
await this.renegotiate(), $();
|
|
8955
|
-
}), await this.setRemoteDescription({ type: "offer", sdp:
|
|
8971
|
+
}), await this.setRemoteDescription({ type: "offer", sdp: Q });
|
|
8956
8972
|
});
|
|
8957
8973
|
};
|
|
8958
8974
|
await D();
|
|
@@ -8986,9 +9002,9 @@ class RoomCalls extends RoomPeer {
|
|
|
8986
9002
|
for (const $ of e) {
|
|
8987
9003
|
const { tracks: N = [] } = $;
|
|
8988
9004
|
for (const D of N) {
|
|
8989
|
-
const { type: q, mid: P, trackName: j, mediaType: V, msid:
|
|
8990
|
-
if (!(!V || !
|
|
8991
|
-
const z = { type: q, mid: P, trackName:
|
|
9005
|
+
const { type: q, mid: P, trackName: j, mediaType: V, msid: Q } = D;
|
|
9006
|
+
if (!(!V || !Q) && (u.length === 0 || u.includes(j))) {
|
|
9007
|
+
const z = { type: q, mid: P, trackName: Q };
|
|
8992
9008
|
n.push(z), await this.closeUserTracks($.id, [D]);
|
|
8993
9009
|
}
|
|
8994
9010
|
}
|
|
@@ -9020,7 +9036,6 @@ class RoomCalls extends RoomPeer {
|
|
|
9020
9036
|
const k = await this.getCaller();
|
|
9021
9037
|
if (!k) return;
|
|
9022
9038
|
const { tracks: e = [] } = k, n = [...e];
|
|
9023
|
-
await this.replaceSenderStream(u, !0);
|
|
9024
9039
|
for (let $ of n) {
|
|
9025
9040
|
const { mediaType: N } = $;
|
|
9026
9041
|
if (N && u.includes(N)) {
|
|
@@ -9031,7 +9046,7 @@ class RoomCalls extends RoomPeer {
|
|
|
9031
9046
|
}
|
|
9032
9047
|
}
|
|
9033
9048
|
const O = await this.getCallAction(n);
|
|
9034
|
-
await
|
|
9049
|
+
await J(this, Rt).call(this, O), await this.emitNotifyUpdateUsers(), _(!0);
|
|
9035
9050
|
}));
|
|
9036
9051
|
/**
|
|
9037
9052
|
* 远端调试
|
|
@@ -9046,21 +9061,21 @@ class RoomCalls extends RoomPeer {
|
|
|
9046
9061
|
}));
|
|
9047
9062
|
}
|
|
9048
9063
|
}
|
|
9049
|
-
|
|
9064
|
+
Yt = new WeakMap(), Rt = new WeakMap(), At = new WeakMap(), qt = new WeakMap(), Dt = new WeakMap();
|
|
9050
9065
|
class Room extends RoomCalls {
|
|
9051
9066
|
constructor(I) {
|
|
9052
9067
|
super(I);
|
|
9053
9068
|
}
|
|
9054
9069
|
}
|
|
9055
|
-
var
|
|
9070
|
+
var $t, Xt, te, ee, ie;
|
|
9056
9071
|
class QuickVO extends Room {
|
|
9057
9072
|
constructor(u) {
|
|
9058
9073
|
super(u);
|
|
9059
|
-
|
|
9074
|
+
st(this, $t, /* @__PURE__ */ new Map());
|
|
9060
9075
|
/**
|
|
9061
9076
|
* 添加内部监听事件
|
|
9062
9077
|
*/
|
|
9063
|
-
|
|
9078
|
+
st(this, Xt, () => {
|
|
9064
9079
|
{
|
|
9065
9080
|
const u = async (E) => {
|
|
9066
9081
|
const { qualities: _ = [] } = E.data, [k] = _;
|
|
@@ -9141,12 +9156,12 @@ class QuickVO extends Room {
|
|
|
9141
9156
|
/**
|
|
9142
9157
|
* cwsIns 发送消息前
|
|
9143
9158
|
*/
|
|
9144
|
-
|
|
9159
|
+
st(this, te, () => {
|
|
9145
9160
|
});
|
|
9146
9161
|
/**
|
|
9147
9162
|
* 重连成功
|
|
9148
9163
|
*/
|
|
9149
|
-
|
|
9164
|
+
st(this, ee, () => {
|
|
9150
9165
|
this.cwsIns.onReconnectSuccess = async () => {
|
|
9151
9166
|
await this.syncRoomInfo();
|
|
9152
9167
|
};
|
|
@@ -9154,7 +9169,7 @@ class QuickVO extends Room {
|
|
|
9154
9169
|
/**
|
|
9155
9170
|
* 重连停止
|
|
9156
9171
|
*/
|
|
9157
|
-
|
|
9172
|
+
st(this, ie, async () => {
|
|
9158
9173
|
});
|
|
9159
9174
|
/**
|
|
9160
9175
|
* 添加 FrameRequestCallback
|
|
@@ -9163,13 +9178,13 @@ class QuickVO extends Room {
|
|
|
9163
9178
|
*/
|
|
9164
9179
|
Z(this, "addRequestAnimationFrame", async (u, E) => {
|
|
9165
9180
|
{
|
|
9166
|
-
const k =
|
|
9181
|
+
const k = J(this, $t).get(u);
|
|
9167
9182
|
k && cancelAnimationFrame(k);
|
|
9168
9183
|
}
|
|
9169
9184
|
const _ = (k = Date.now()) => {
|
|
9170
9185
|
E(k);
|
|
9171
9186
|
const e = requestAnimationFrame(_);
|
|
9172
|
-
|
|
9187
|
+
J(this, $t).set(u, e);
|
|
9173
9188
|
};
|
|
9174
9189
|
_();
|
|
9175
9190
|
});
|
|
@@ -9178,10 +9193,10 @@ class QuickVO extends Room {
|
|
|
9178
9193
|
* @param keys string[] = []
|
|
9179
9194
|
*/
|
|
9180
9195
|
Z(this, "clearRequestAnimationFrame", async (u = []) => {
|
|
9181
|
-
u.length === 0 && (u = [...
|
|
9196
|
+
u.length === 0 && (u = [...J(this, $t).keys()]);
|
|
9182
9197
|
const E = [];
|
|
9183
9198
|
for (const _ of u) {
|
|
9184
|
-
const k =
|
|
9199
|
+
const k = J(this, $t).get(_);
|
|
9185
9200
|
k && (cancelAnimationFrame(k), E.push(k));
|
|
9186
9201
|
}
|
|
9187
9202
|
return E;
|
|
@@ -9193,10 +9208,10 @@ class QuickVO extends Room {
|
|
|
9193
9208
|
Z(this, "destroy", async () => {
|
|
9194
9209
|
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();
|
|
9195
9210
|
});
|
|
9196
|
-
|
|
9211
|
+
J(this, te).call(this), J(this, ee).call(this), J(this, ie).call(this), J(this, Xt).call(this);
|
|
9197
9212
|
}
|
|
9198
9213
|
}
|
|
9199
|
-
|
|
9214
|
+
$t = new WeakMap(), Xt = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ie = new WeakMap();
|
|
9200
9215
|
export {
|
|
9201
9216
|
QuickVO,
|
|
9202
9217
|
ignoreEvent
|