quickvo-sdk-js 0.5.5 → 0.5.6
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 +224 -184
- package/dist/index.umd.cjs +2 -2
- package/dist/room/RoomCalls.d.ts +1 -1
- package/dist/room/RoomMedias.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var te = (a) => {
|
|
|
4
4
|
};
|
|
5
5
|
var ne = (a, I, u) => I in a ? ie(a, I, { enumerable: !0, configurable: !0, writable: !0, value: u }) : a[I] = u;
|
|
6
6
|
var Z = (a, I, u) => ne(a, typeof I != "symbol" ? I + "" : I, u), ee = (a, I, u) => I.has(a) || te("Cannot " + u);
|
|
7
|
-
var
|
|
7
|
+
var Q = (a, I, u) => (ee(a, I, "read from private field"), u ? u.call(a) : I.get(a)), at = (a, I, u) => I.has(a) ? te("Cannot add the same private member more than once") : I instanceof WeakSet ? I.add(a) : I.set(a, u), wt = (a, I, u, E) => (ee(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()}`,
|
|
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)}`, J = `${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: $ },
|
|
@@ -98,7 +98,7 @@ const L = (a, I = []) => {
|
|
|
98
98
|
// 分
|
|
99
99
|
{ k: "s+", v: j },
|
|
100
100
|
// 秒
|
|
101
|
-
{ k: "d+", v:
|
|
101
|
+
{ k: "d+", v: V },
|
|
102
102
|
// 第几天
|
|
103
103
|
{ k: "w+", v: J }
|
|
104
104
|
// 第几周
|
|
@@ -591,9 +591,9 @@ function requireParser() {
|
|
|
591
591
|
var q = D[0], P = D.slice(2);
|
|
592
592
|
q === "m" && ($.push({ rtp: [], fmtp: [] }), N = $[$.length - 1]);
|
|
593
593
|
for (var j = 0; j < (_[q] || []).length; j += 1) {
|
|
594
|
-
var
|
|
595
|
-
if (
|
|
596
|
-
return E(
|
|
594
|
+
var V = _[q][j];
|
|
595
|
+
if (V.reg.test(P))
|
|
596
|
+
return E(V, N, P);
|
|
597
597
|
}
|
|
598
598
|
}), O.media = $, O;
|
|
599
599
|
};
|
|
@@ -954,16 +954,16 @@ function requireBase64() {
|
|
|
954
954
|
E[u[_] = _ < 26 ? _ + 65 : _ < 52 ? _ + 71 : _ < 62 ? _ - 4 : _ - 59 | 43] = _++;
|
|
955
955
|
I.encode = function(n, O, $) {
|
|
956
956
|
for (var N = null, D = [], q = 0, P = 0, j; O < $; ) {
|
|
957
|
-
var
|
|
957
|
+
var V = n[O++];
|
|
958
958
|
switch (P) {
|
|
959
959
|
case 0:
|
|
960
|
-
D[q++] = u[
|
|
960
|
+
D[q++] = u[V >> 2], j = (V & 3) << 4, P = 1;
|
|
961
961
|
break;
|
|
962
962
|
case 1:
|
|
963
|
-
D[q++] = u[j |
|
|
963
|
+
D[q++] = u[j | V >> 4], j = (V & 15) << 2, P = 2;
|
|
964
964
|
break;
|
|
965
965
|
case 2:
|
|
966
|
-
D[q++] = u[j |
|
|
966
|
+
D[q++] = u[j | V >> 6], D[q++] = u[V & 63], P = 0;
|
|
967
967
|
break;
|
|
968
968
|
}
|
|
969
969
|
q > 8191 && ((N || (N = [])).push(String.fromCharCode.apply(String, D)), q = 0);
|
|
@@ -1040,11 +1040,11 @@ function requireFloat() {
|
|
|
1040
1040
|
function a(k) {
|
|
1041
1041
|
return typeof Float32Array < "u" ? function() {
|
|
1042
1042
|
var e = new Float32Array([-0]), n = new Uint8Array(e.buffer), O = n[3] === 128;
|
|
1043
|
-
function $(P, j,
|
|
1044
|
-
e[0] = P, j[
|
|
1043
|
+
function $(P, j, V) {
|
|
1044
|
+
e[0] = P, j[V] = n[0], j[V + 1] = n[1], j[V + 2] = n[2], j[V + 3] = n[3];
|
|
1045
1045
|
}
|
|
1046
|
-
function N(P, j,
|
|
1047
|
-
e[0] = P, j[
|
|
1046
|
+
function N(P, j, V) {
|
|
1047
|
+
e[0] = P, j[V] = n[3], j[V + 1] = n[2], j[V + 2] = n[1], j[V + 3] = n[0];
|
|
1048
1048
|
}
|
|
1049
1049
|
k.writeFloatLE = O ? $ : N, k.writeFloatBE = O ? N : $;
|
|
1050
1050
|
function D(P, j) {
|
|
@@ -1084,11 +1084,11 @@ function requireFloat() {
|
|
|
1084
1084
|
k.readFloatLE = n.bind(null, E), k.readFloatBE = n.bind(null, _);
|
|
1085
1085
|
}(), typeof Float64Array < "u" ? function() {
|
|
1086
1086
|
var e = new Float64Array([-0]), n = new Uint8Array(e.buffer), O = n[7] === 128;
|
|
1087
|
-
function $(P, j,
|
|
1088
|
-
e[0] = P, j[
|
|
1087
|
+
function $(P, j, V) {
|
|
1088
|
+
e[0] = P, j[V] = n[0], j[V + 1] = n[1], j[V + 2] = n[2], j[V + 3] = n[3], j[V + 4] = n[4], j[V + 5] = n[5], j[V + 6] = n[6], j[V + 7] = n[7];
|
|
1089
1089
|
}
|
|
1090
|
-
function N(P, j,
|
|
1091
|
-
e[0] = P, j[
|
|
1090
|
+
function N(P, j, V) {
|
|
1091
|
+
e[0] = P, j[V] = n[7], j[V + 1] = n[6], j[V + 2] = n[5], j[V + 3] = n[4], j[V + 4] = n[3], j[V + 5] = n[2], j[V + 6] = n[1], j[V + 7] = n[0];
|
|
1092
1092
|
}
|
|
1093
1093
|
k.writeDoubleLE = O ? $ : N, k.writeDoubleBE = O ? N : $;
|
|
1094
1094
|
function D(P, j) {
|
|
@@ -1114,19 +1114,19 @@ function requireFloat() {
|
|
|
1114
1114
|
else if (D > 17976931348623157e292)
|
|
1115
1115
|
O(0, q, P + $), O((j << 31 | 2146435072) >>> 0, q, P + N);
|
|
1116
1116
|
else {
|
|
1117
|
-
var
|
|
1117
|
+
var V;
|
|
1118
1118
|
if (D < 22250738585072014e-324)
|
|
1119
|
-
|
|
1119
|
+
V = D / 5e-324, O(V >>> 0, q, P + $), O((j << 31 | V / 4294967296) >>> 0, q, P + N);
|
|
1120
1120
|
else {
|
|
1121
1121
|
var J = Math.floor(Math.log(D) / Math.LN2);
|
|
1122
|
-
J === 1024 && (J = 1023),
|
|
1122
|
+
J === 1024 && (J = 1023), V = D * Math.pow(2, -J), O(V * 4503599627370496 >>> 0, q, P + $), O((j << 31 | J + 1023 << 20 | V * 1048576 & 1048575) >>> 0, q, P + N);
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
1125
|
}
|
|
1126
1126
|
k.writeDoubleLE = e.bind(null, I, 0, 4), k.writeDoubleBE = e.bind(null, u, 4, 0);
|
|
1127
1127
|
function n(O, $, N, D, q) {
|
|
1128
|
-
var P = O(D, q + $), j = O(D, q + N),
|
|
1129
|
-
return J === 2047 ? z ? NaN :
|
|
1128
|
+
var P = O(D, q + $), j = O(D, q + N), V = (j >> 31) * 2 + 1, J = j >>> 20 & 2047, z = 4294967296 * (j & 1048575) + P;
|
|
1129
|
+
return J === 2047 ? z ? NaN : V * (1 / 0) : J === 0 ? V * 5e-324 * z : V * Math.pow(2, J - 1075) * (z + 4503599627370496);
|
|
1130
1130
|
}
|
|
1131
1131
|
k.readDoubleLE = n.bind(null, E, 0, 4), k.readDoubleBE = n.bind(null, _, 4, 0);
|
|
1132
1132
|
}(), k;
|
|
@@ -1474,7 +1474,7 @@ function requireWriter() {
|
|
|
1474
1474
|
}, O.prototype.double = function(z) {
|
|
1475
1475
|
return this._push(a.float.writeDoubleLE, 8, z);
|
|
1476
1476
|
};
|
|
1477
|
-
var
|
|
1477
|
+
var V = a.Array.prototype.set ? function(z, Y, et) {
|
|
1478
1478
|
Y.set(z, et);
|
|
1479
1479
|
} : function(z, Y, et) {
|
|
1480
1480
|
for (var tt = 0; tt < z.length; ++tt)
|
|
@@ -1488,7 +1488,7 @@ function requireWriter() {
|
|
|
1488
1488
|
var et = O.alloc(Y = E.length(z));
|
|
1489
1489
|
E.decode(z, et, 0), z = et;
|
|
1490
1490
|
}
|
|
1491
|
-
return this.uint32(Y)._push(
|
|
1491
|
+
return this.uint32(Y)._push(V, Y, z);
|
|
1492
1492
|
}, O.prototype.string = function(z) {
|
|
1493
1493
|
var Y = _.length(z);
|
|
1494
1494
|
return Y ? this.uint32(Y)._push(_.write, Y, z) : this._push(N, 1, 0);
|
|
@@ -1560,8 +1560,8 @@ function requireReader() {
|
|
|
1560
1560
|
throw Error("illegal buffer");
|
|
1561
1561
|
}, n = function() {
|
|
1562
1562
|
return a.Buffer ? function(P) {
|
|
1563
|
-
return (k.create = function(
|
|
1564
|
-
return a.Buffer.isBuffer(
|
|
1563
|
+
return (k.create = function(V) {
|
|
1564
|
+
return a.Buffer.isBuffer(V) ? new I(V) : e(V);
|
|
1565
1565
|
})(P);
|
|
1566
1566
|
} : e;
|
|
1567
1567
|
};
|
|
@@ -1648,8 +1648,8 @@ function requireReader() {
|
|
|
1648
1648
|
if (this.pos += q, Array.isArray(this.buf))
|
|
1649
1649
|
return this.buf.slice(P, j);
|
|
1650
1650
|
if (P === j) {
|
|
1651
|
-
var
|
|
1652
|
-
return
|
|
1651
|
+
var V = a.Buffer;
|
|
1652
|
+
return V ? V.alloc(0) : new this.buf.constructor(0);
|
|
1653
1653
|
}
|
|
1654
1654
|
return this._slice.call(this.buf, P, j);
|
|
1655
1655
|
}, k.prototype.string = function() {
|
|
@@ -5339,17 +5339,17 @@ const d_code = (a) => a < 256 ? _dist_code[a] : _dist_code[256 + (a >>> 7)], put
|
|
|
5339
5339
|
a.bi_valid === 16 ? (put_short(a, a.bi_buf), a.bi_buf = 0, a.bi_valid = 0) : a.bi_valid >= 8 && (a.pending_buf[a.pending++] = a.bi_buf & 255, a.bi_buf >>= 8, a.bi_valid -= 8);
|
|
5340
5340
|
}, gen_bitlen = (a, I) => {
|
|
5341
5341
|
const u = I.dyn_tree, E = I.max_code, _ = I.stat_desc.static_tree, k = I.stat_desc.has_stree, e = I.stat_desc.extra_bits, n = I.stat_desc.extra_base, O = I.stat_desc.max_length;
|
|
5342
|
-
let $, N, D, q, P, j,
|
|
5342
|
+
let $, N, D, q, P, j, V = 0;
|
|
5343
5343
|
for (q = 0; q <= MAX_BITS$1; q++)
|
|
5344
5344
|
a.bl_count[q] = 0;
|
|
5345
5345
|
for (u[a.heap[a.heap_max] * 2 + 1] = 0, $ = a.heap_max + 1; $ < HEAP_SIZE$1; $++)
|
|
5346
|
-
N = a.heap[$], q = u[u[N * 2 + 1] * 2 + 1] + 1, q > O && (q = O,
|
|
5347
|
-
if (
|
|
5346
|
+
N = a.heap[$], q = u[u[N * 2 + 1] * 2 + 1] + 1, q > O && (q = O, V++), u[N * 2 + 1] = q, !(N > E) && (a.bl_count[q]++, P = 0, N >= n && (P = e[N - n]), j = u[N * 2], a.opt_len += j * (q + P), k && (a.static_len += j * (_[N * 2 + 1] + P)));
|
|
5347
|
+
if (V !== 0) {
|
|
5348
5348
|
do {
|
|
5349
5349
|
for (q = O - 1; a.bl_count[q] === 0; )
|
|
5350
5350
|
q--;
|
|
5351
|
-
a.bl_count[q]--, a.bl_count[q + 1] += 2, a.bl_count[O]--,
|
|
5352
|
-
} while (
|
|
5351
|
+
a.bl_count[q]--, a.bl_count[q + 1] += 2, a.bl_count[O]--, V -= 2;
|
|
5352
|
+
} while (V > 0);
|
|
5353
5353
|
for (q = O; q !== 0; q--)
|
|
5354
5354
|
for (N = a.bl_count[q]; N !== 0; )
|
|
5355
5355
|
D = a.heap[--$], !(D > E) && (u[D * 2 + 1] !== q && (a.opt_len += (q - u[D * 2 + 1]) * u[D * 2], u[D * 2 + 1] = q), N--);
|
|
@@ -6134,12 +6134,12 @@ var Deflate_1$1 = Deflate$1, deflate_2 = deflate$1, deflateRaw_1$1 = deflateRaw$
|
|
|
6134
6134
|
};
|
|
6135
6135
|
const BAD$1 = 16209, TYPE$1 = 16191;
|
|
6136
6136
|
var inffast = function a(I, u) {
|
|
6137
|
-
let E, _, k, e, n, O, $, N, D, q, P, j,
|
|
6137
|
+
let E, _, k, e, n, O, $, N, D, q, P, j, V, J, z, Y, et, tt, nt, lt, it, st, ct, ot;
|
|
6138
6138
|
const rt = I.state;
|
|
6139
|
-
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,
|
|
6139
|
+
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, J = rt.distcode, z = (1 << rt.lenbits) - 1, Y = (1 << rt.distbits) - 1;
|
|
6140
6140
|
t:
|
|
6141
6141
|
do {
|
|
6142
|
-
j < 15 && (P += ct[E++] << j, j += 8, P += ct[E++] << j, j += 8), et =
|
|
6142
|
+
j < 15 && (P += ct[E++] << j, j += 8, P += ct[E++] << j, j += 8), et = V[P & z];
|
|
6143
6143
|
e:
|
|
6144
6144
|
for (; ; ) {
|
|
6145
6145
|
if (tt = et >>> 24, P >>>= tt, j -= tt, tt = et >>> 16 & 255, tt === 0)
|
|
@@ -6207,7 +6207,7 @@ var inffast = function a(I, u) {
|
|
|
6207
6207
|
break;
|
|
6208
6208
|
}
|
|
6209
6209
|
} else if ((tt & 64) === 0) {
|
|
6210
|
-
et =
|
|
6210
|
+
et = V[(et & 65535) + (P & (1 << tt) - 1)];
|
|
6211
6211
|
continue e;
|
|
6212
6212
|
} else if (tt & 32) {
|
|
6213
6213
|
rt.mode = TYPE$1;
|
|
@@ -6357,7 +6357,7 @@ const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS
|
|
|
6357
6357
|
64
|
|
6358
6358
|
]), inflate_table = (a, I, u, E, _, k, e, n) => {
|
|
6359
6359
|
const O = n.bits;
|
|
6360
|
-
let $ = 0, N = 0, D = 0, q = 0, P = 0, j = 0,
|
|
6360
|
+
let $ = 0, N = 0, D = 0, q = 0, P = 0, j = 0, V = 0, J = 0, z = 0, Y = 0, et, tt, nt, lt, it, st = null, ct;
|
|
6361
6361
|
const ot = new Uint16Array(MAXBITS + 1), rt = new Uint16Array(MAXBITS + 1);
|
|
6362
6362
|
let Ot = null, Xt, Nt, At;
|
|
6363
6363
|
for ($ = 0; $ <= MAXBITS; $++)
|
|
@@ -6379,12 +6379,12 @@ const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS
|
|
|
6379
6379
|
rt[$ + 1] = rt[$] + ot[$];
|
|
6380
6380
|
for (N = 0; N < E; N++)
|
|
6381
6381
|
I[u + N] !== 0 && (e[rt[I[u + N]]++] = N);
|
|
6382
|
-
if (a === CODES$1 ? (st = Ot = e, ct = 20) : a === LENS$1 ? (st = lbase, Ot = lext, ct = 257) : (st = dbase, Ot = dext, ct = 0), Y = 0, N = 0, $ = D, it = k, j = P,
|
|
6382
|
+
if (a === CODES$1 ? (st = Ot = e, ct = 20) : a === LENS$1 ? (st = lbase, Ot = lext, ct = 257) : (st = dbase, Ot = 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)
|
|
6383
6383
|
return 1;
|
|
6384
6384
|
for (; ; ) {
|
|
6385
|
-
Xt = $ -
|
|
6385
|
+
Xt = $ - V, e[N] + 1 < ct ? (Nt = 0, At = e[N]) : e[N] >= ct ? (Nt = Ot[e[N] - ct], At = st[e[N] - ct]) : (Nt = 96, At = 0), et = 1 << $ - V, tt = 1 << j, D = tt;
|
|
6386
6386
|
do
|
|
6387
|
-
tt -= et, _[it + (Y >>
|
|
6387
|
+
tt -= et, _[it + (Y >> V) + tt] = Xt << 24 | Nt << 16 | At | 0;
|
|
6388
6388
|
while (tt !== 0);
|
|
6389
6389
|
for (et = 1 << $ - 1; Y & et; )
|
|
6390
6390
|
et >>= 1;
|
|
@@ -6394,14 +6394,14 @@ const MAXBITS = 15, ENOUGH_LENS$1 = 852, ENOUGH_DISTS$1 = 592, CODES$1 = 0, LENS
|
|
|
6394
6394
|
$ = I[u + e[N]];
|
|
6395
6395
|
}
|
|
6396
6396
|
if ($ > P && (Y & lt) !== nt) {
|
|
6397
|
-
for (
|
|
6397
|
+
for (V === 0 && (V = P), it += D, j = $ - V, J = 1 << j; j + V < q && (J -= ot[j + V], !(J <= 0)); )
|
|
6398
6398
|
j++, J <<= 1;
|
|
6399
6399
|
if (z += 1 << j, a === LENS$1 && z > ENOUGH_LENS$1 || a === DISTS$1 && z > ENOUGH_DISTS$1)
|
|
6400
6400
|
return 1;
|
|
6401
6401
|
nt = Y & lt, _[nt] = P << 24 | j << 16 | it - k | 0;
|
|
6402
6402
|
}
|
|
6403
6403
|
}
|
|
6404
|
-
return Y !== 0 && (_[it + Y] = $ -
|
|
6404
|
+
return Y !== 0 && (_[it + Y] = $ - V << 24 | 64 << 16 | 0), n.bits = P, 0;
|
|
6405
6405
|
};
|
|
6406
6406
|
var inftrees = inflate_table;
|
|
6407
6407
|
const CODES = 0, LENS = 1, DISTS = 2, {
|
|
@@ -6472,7 +6472,7 @@ const fixedtables = (a) => {
|
|
|
6472
6472
|
const k = a.state;
|
|
6473
6473
|
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;
|
|
6474
6474
|
}, inflate$2 = (a, I) => {
|
|
6475
|
-
let u, E, _, k, e, n, O, $, N, D, q, P, j,
|
|
6475
|
+
let u, E, _, k, e, n, O, $, N, D, q, P, j, V, J = 0, z, Y, et, tt, nt, lt, it, st;
|
|
6476
6476
|
const ct = new Uint8Array(4);
|
|
6477
6477
|
let ot, rt;
|
|
6478
6478
|
const Ot = (
|
|
@@ -6861,12 +6861,12 @@ const fixedtables = (a) => {
|
|
|
6861
6861
|
a.msg = "invalid distance too far back", u.mode = BAD;
|
|
6862
6862
|
break;
|
|
6863
6863
|
}
|
|
6864
|
-
P > u.wnext ? (P -= u.wnext, j = u.wsize - P) : j = u.wnext - P, P > u.length && (P = u.length),
|
|
6864
|
+
P > u.wnext ? (P -= u.wnext, j = u.wsize - P) : j = u.wnext - P, P > u.length && (P = u.length), V = u.window;
|
|
6865
6865
|
} else
|
|
6866
|
-
|
|
6866
|
+
V = _, j = e - u.offset, P = u.length;
|
|
6867
6867
|
P > O && (P = O), O -= P, u.length -= P;
|
|
6868
6868
|
do
|
|
6869
|
-
_[e++] =
|
|
6869
|
+
_[e++] = V[j++];
|
|
6870
6870
|
while (--P);
|
|
6871
6871
|
u.length === 0 && (u.mode = LEN);
|
|
6872
6872
|
break;
|
|
@@ -7154,11 +7154,11 @@ const noLogEvents = ["heartbeat", "onNetQuality", "networkQualityChange"], compr
|
|
|
7154
7154
|
}
|
|
7155
7155
|
return a;
|
|
7156
7156
|
};
|
|
7157
|
-
var
|
|
7157
|
+
var vt, ut, Rt, yt, _t, qt, Dt, Ct, Ut, Et, Mt, Pt, Bt;
|
|
7158
7158
|
class CallsWebSocket {
|
|
7159
7159
|
// 状态
|
|
7160
7160
|
constructor(I) {
|
|
7161
|
-
at(this,
|
|
7161
|
+
at(this, vt);
|
|
7162
7162
|
at(this, ut, {
|
|
7163
7163
|
url: "wss://demo.putplay.cc/websocket",
|
|
7164
7164
|
// 地址
|
|
@@ -7170,8 +7170,8 @@ class CallsWebSocket {
|
|
|
7170
7170
|
});
|
|
7171
7171
|
at(this, Rt, "");
|
|
7172
7172
|
// 缓存登录凭证
|
|
7173
|
-
at(this, dt, {});
|
|
7174
7173
|
at(this, yt, {});
|
|
7174
|
+
at(this, _t, {});
|
|
7175
7175
|
Z(this, "state", "closed");
|
|
7176
7176
|
// 外部 发送消息之前
|
|
7177
7177
|
Z(this, "sendMessageBefore", async () => {
|
|
@@ -7190,11 +7190,11 @@ class CallsWebSocket {
|
|
|
7190
7190
|
});
|
|
7191
7191
|
// 重连成功
|
|
7192
7192
|
at(this, Dt, async (I) => {
|
|
7193
|
-
|
|
7193
|
+
Q(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);
|
|
7194
7194
|
});
|
|
7195
7195
|
// 重连停止
|
|
7196
7196
|
at(this, Ct, async (I) => {
|
|
7197
|
-
|
|
7197
|
+
Q(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);
|
|
7198
7198
|
});
|
|
7199
7199
|
// 自定义心跳规则
|
|
7200
7200
|
at(this, Ut, () => {
|
|
@@ -7223,7 +7223,7 @@ class CallsWebSocket {
|
|
|
7223
7223
|
}
|
|
7224
7224
|
let P = "#quickvo.logs";
|
|
7225
7225
|
ignoreEvent.includes(_) && (P = "#quickvo.ignoreEvents");
|
|
7226
|
-
const j = { "#action": q, timeStr: $, event: _, data: N, time: E, ...O },
|
|
7226
|
+
const j = { "#action": q, timeStr: $, event: _, data: N, time: E, ...O }, V = localStorage.getItem(P) || JSON.stringify([]), J = JSON.parse(V), z = [j, ...J].slice(0, 500);
|
|
7227
7227
|
localStorage.setItem(P, JSON.stringify(z));
|
|
7228
7228
|
} catch (E) {
|
|
7229
7229
|
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: updataLogs is error", E);
|
|
@@ -7232,22 +7232,22 @@ class CallsWebSocket {
|
|
|
7232
7232
|
// 创建事件
|
|
7233
7233
|
at(this, Mt, (I, { resolve: u, reject: E }) => {
|
|
7234
7234
|
const { sn: _ } = I, k = () => {
|
|
7235
|
-
const n =
|
|
7236
|
-
clearTimeout(n.destructionTimer), delete
|
|
7235
|
+
const n = Q(this, yt)[_];
|
|
7236
|
+
clearTimeout(n.destructionTimer), delete Q(this, yt)[_];
|
|
7237
7237
|
}, e = setTimeout(() => {
|
|
7238
|
-
const n =
|
|
7238
|
+
const n = Q(this, yt)[_];
|
|
7239
7239
|
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");
|
|
7240
|
-
},
|
|
7241
|
-
|
|
7240
|
+
}, Q(this, ut).timeout);
|
|
7241
|
+
Q(this, yt)[_] = { message: I, resolve: u, reject: E, destruction: k, destructionTimer: e };
|
|
7242
7242
|
});
|
|
7243
7243
|
// 获取事件
|
|
7244
|
-
at(this, Pt, (I) =>
|
|
7244
|
+
at(this, Pt, (I) => Q(this, yt)[I]);
|
|
7245
7245
|
// 接收消息
|
|
7246
7246
|
at(this, Bt, async (I) => {
|
|
7247
7247
|
const u = new Uint8Array(I), E = com.quick.voice.proto.CommonRsp.decode(u), { sn: _, event: k } = E, e = onMessageFormat(E);
|
|
7248
|
-
if (
|
|
7248
|
+
if (Q(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) || Q(this, Et).call(this, "res", e)), notifyName_keys.includes(k))
|
|
7249
7249
|
return this.emitNotify(k, L(e, ["code", "data", "desc"]));
|
|
7250
|
-
const O =
|
|
7250
|
+
const O = Q(this, Pt).call(this, _);
|
|
7251
7251
|
if (O) {
|
|
7252
7252
|
const { resolve: $ = (D) => {
|
|
7253
7253
|
}, destruction: N = () => {
|
|
@@ -7257,12 +7257,12 @@ class CallsWebSocket {
|
|
|
7257
7257
|
});
|
|
7258
7258
|
// 清除事件
|
|
7259
7259
|
Z(this, "clearEvents", (I = []) => {
|
|
7260
|
-
const u = Object.keys(
|
|
7260
|
+
const u = Object.keys(Q(this, yt));
|
|
7261
7261
|
I.length === 0 && (I = u);
|
|
7262
7262
|
for (const E of u) {
|
|
7263
7263
|
if (!I.includes(E)) continue;
|
|
7264
|
-
const _ =
|
|
7265
|
-
clearTimeout(_.destructionTimer), delete
|
|
7264
|
+
const _ = Q(this, yt)[E];
|
|
7265
|
+
clearTimeout(_.destructionTimer), delete Q(this, yt)[E];
|
|
7266
7266
|
}
|
|
7267
7267
|
});
|
|
7268
7268
|
/**
|
|
@@ -7271,31 +7271,31 @@ class CallsWebSocket {
|
|
|
7271
7271
|
* @returns
|
|
7272
7272
|
*/
|
|
7273
7273
|
Z(this, "connect", async (I = "") => new Promise(async (u) => {
|
|
7274
|
-
I &&
|
|
7275
|
-
const E = `${
|
|
7276
|
-
|
|
7277
|
-
...
|
|
7274
|
+
I && wt(this, Rt, I), Q(this, vt) && (await Q(this, vt).close(), this.state = "closed");
|
|
7275
|
+
const E = `${Q(this, ut).url}?s=${Q(this, Rt)}&t=${Date.now()}`;
|
|
7276
|
+
wt(this, vt, new M({
|
|
7277
|
+
...Q(this, ut),
|
|
7278
7278
|
url: E,
|
|
7279
7279
|
binaryType: "arraybuffer",
|
|
7280
|
-
onMessage:
|
|
7281
|
-
checkReconnect:
|
|
7282
|
-
getHeartbeatMsg:
|
|
7283
|
-
onReconnectSuccess:
|
|
7284
|
-
onReconnectStop:
|
|
7285
|
-
})), this.state = "connecting", await
|
|
7280
|
+
onMessage: Q(this, Bt),
|
|
7281
|
+
checkReconnect: Q(this, qt),
|
|
7282
|
+
getHeartbeatMsg: Q(this, Ut),
|
|
7283
|
+
onReconnectSuccess: Q(this, Dt),
|
|
7284
|
+
onReconnectStop: Q(this, Ct)
|
|
7285
|
+
})), this.state = "connecting", await Q(this, vt).connect(), this.state = "connected", Q(this, ut).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: 当前广播事件", Q(this, _t)), u(Q(this, vt));
|
|
7286
7286
|
}));
|
|
7287
7287
|
/**
|
|
7288
7288
|
* 关闭
|
|
7289
7289
|
*/
|
|
7290
7290
|
Z(this, "close", async () => {
|
|
7291
7291
|
var u;
|
|
7292
|
-
|
|
7293
|
-
const I = Object.keys(
|
|
7292
|
+
Q(this, ut).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: cws is close.");
|
|
7293
|
+
const I = Object.keys(Q(this, yt));
|
|
7294
7294
|
for (const E of I) {
|
|
7295
|
-
const { destructionTimer: _ } =
|
|
7295
|
+
const { destructionTimer: _ } = Q(this, yt)[E];
|
|
7296
7296
|
clearTimeout(_);
|
|
7297
7297
|
}
|
|
7298
|
-
|
|
7298
|
+
wt(this, yt, {}), await ((u = Q(this, vt)) == null ? void 0 : u.close()), wt(this, vt, void 0), this.state = "closed";
|
|
7299
7299
|
});
|
|
7300
7300
|
/**
|
|
7301
7301
|
* 发送消息
|
|
@@ -7308,14 +7308,14 @@ class CallsWebSocket {
|
|
|
7308
7308
|
event: k,
|
|
7309
7309
|
sn: +`${n}${F(1e3, 9999)}`,
|
|
7310
7310
|
time: n,
|
|
7311
|
-
valid:
|
|
7311
|
+
valid: Q(this, ut).timeout,
|
|
7312
7312
|
version: 1,
|
|
7313
7313
|
compress: !1,
|
|
7314
7314
|
...e
|
|
7315
7315
|
});
|
|
7316
|
-
|
|
7316
|
+
Q(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) || Q(this, Et).call(this, "req", O)), u && Q(this, Mt).call(this, O, { resolve: E, reject: _ });
|
|
7317
7317
|
const $ = com.quick.voice.proto.CommonReq.encode(O).finish();
|
|
7318
|
-
(N =
|
|
7318
|
+
(N = Q(this, vt)) == null || N.sendMessage($);
|
|
7319
7319
|
}));
|
|
7320
7320
|
/**
|
|
7321
7321
|
* 触发广播事件
|
|
@@ -7323,7 +7323,7 @@ class CallsWebSocket {
|
|
|
7323
7323
|
* @param result 事件响应值
|
|
7324
7324
|
*/
|
|
7325
7325
|
Z(this, "emitNotify", async (I, u) => {
|
|
7326
|
-
const E =
|
|
7326
|
+
const E = Q(this, _t)[I] || [];
|
|
7327
7327
|
for (const _ of E) {
|
|
7328
7328
|
const { callback: k = async () => {
|
|
7329
7329
|
} } = _;
|
|
@@ -7338,8 +7338,8 @@ class CallsWebSocket {
|
|
|
7338
7338
|
*/
|
|
7339
7339
|
Z(this, "addNotify", (I, u = !1) => {
|
|
7340
7340
|
const { event: E, sn: _ = ht(32) } = I;
|
|
7341
|
-
|
|
7342
|
-
const k =
|
|
7341
|
+
Q(this, _t)[E] || (Q(this, _t)[E] = []);
|
|
7342
|
+
const k = Q(this, _t)[E], e = k.findIndex((n) => n.sn === _);
|
|
7343
7343
|
return e !== -1 && k.splice(e, 1), u ? k.unshift(I) : k.push(I), _;
|
|
7344
7344
|
});
|
|
7345
7345
|
/**
|
|
@@ -7347,18 +7347,18 @@ class CallsWebSocket {
|
|
|
7347
7347
|
*/
|
|
7348
7348
|
Z(this, "removeNotify", (I = []) => {
|
|
7349
7349
|
if (I.length === 0)
|
|
7350
|
-
|
|
7350
|
+
wt(this, _t, {});
|
|
7351
7351
|
else {
|
|
7352
|
-
const u = Object.keys(
|
|
7352
|
+
const u = Object.keys(Q(this, _t));
|
|
7353
7353
|
for (const E of u)
|
|
7354
|
-
|
|
7354
|
+
Q(this, _t)[E] = Q(this, _t)[E].filter((_) => !I.includes(_.sn || ""));
|
|
7355
7355
|
}
|
|
7356
|
-
|
|
7356
|
+
Q(this, ut).debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: 移除广播事件", Q(this, _t));
|
|
7357
7357
|
});
|
|
7358
|
-
|
|
7358
|
+
wt(this, ut, { ...Q(this, ut), ...I });
|
|
7359
7359
|
}
|
|
7360
7360
|
}
|
|
7361
|
-
|
|
7361
|
+
vt = new WeakMap(), ut = new WeakMap(), Rt = new WeakMap(), yt = new WeakMap(), _t = new WeakMap(), qt = new WeakMap(), Dt = new WeakMap(), Ct = new WeakMap(), Ut = new WeakMap(), Et = new WeakMap(), Mt = new WeakMap(), Pt = new WeakMap(), Bt = new WeakMap();
|
|
7362
7362
|
var y = Object.defineProperty, x = (a) => {
|
|
7363
7363
|
throw TypeError(a);
|
|
7364
7364
|
}, 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;
|
|
@@ -7551,33 +7551,33 @@ class RoomBase {
|
|
|
7551
7551
|
* 处理为应用层数据
|
|
7552
7552
|
*/
|
|
7553
7553
|
Z(this, "usersFilter", (I) => ft(I, ["id", "isSelf", "joinTime", "tracks", "callAction", "callActionStr", "callActionMap", "network", "permissions", "isPublished", "updateStreams"]).sort((_, k) => _.id.localeCompare(k.id, "en")));
|
|
7554
|
-
|
|
7554
|
+
Q(this, Lt).call(this);
|
|
7555
7555
|
}
|
|
7556
7556
|
}
|
|
7557
7557
|
Lt = new WeakMap();
|
|
7558
|
-
var $t,
|
|
7558
|
+
var $t, kt, dt, bt, jt, Zt, Tt, Ft;
|
|
7559
7559
|
class RoomMedias extends RoomBase {
|
|
7560
7560
|
// 媒体流上下文
|
|
7561
7561
|
constructor() {
|
|
7562
7562
|
super();
|
|
7563
7563
|
at(this, $t, []);
|
|
7564
7564
|
// 可用媒体设备列表
|
|
7565
|
-
at(this,
|
|
7565
|
+
at(this, kt, /* @__PURE__ */ new Map());
|
|
7566
7566
|
// 媒体流设备管理
|
|
7567
|
-
at(this,
|
|
7567
|
+
at(this, dt, /* @__PURE__ */ new Map());
|
|
7568
7568
|
// 媒体轨道参数管理
|
|
7569
|
-
at(this,
|
|
7569
|
+
at(this, bt, /* @__PURE__ */ new Map());
|
|
7570
7570
|
/**
|
|
7571
7571
|
* 初始化媒体参数
|
|
7572
7572
|
*/
|
|
7573
7573
|
at(this, jt, () => {
|
|
7574
|
-
|
|
7574
|
+
Q(this, dt).set("microphoneCamera_audio", {}), Q(this, dt).set("microphoneCamera_video", { width: { ideal: 1920 }, height: { ideal: 1080 }, frameRate: { min: 10, ideal: 30 } }), Q(this, dt).set("screenSharing_video", { width: { ideal: 1920 }, height: { ideal: 1080 }, frameRate: { min: 10, ideal: 30 } }), Q(this, dt).set("screenSharing_audio", {});
|
|
7575
7575
|
});
|
|
7576
7576
|
/**
|
|
7577
7577
|
* 初始化媒体设备类型
|
|
7578
7578
|
*/
|
|
7579
7579
|
at(this, Zt, () => {
|
|
7580
|
-
|
|
7580
|
+
Q(this, kt).set("audioinput", "default"), Q(this, kt).set("videoinput", "default"), Q(this, kt).set("audiooutput", "default");
|
|
7581
7581
|
});
|
|
7582
7582
|
/**
|
|
7583
7583
|
* 房间所有用户所有媒体流变化
|
|
@@ -7602,14 +7602,14 @@ class RoomMedias extends RoomBase {
|
|
|
7602
7602
|
case "audio":
|
|
7603
7603
|
{
|
|
7604
7604
|
const $ = new AudioMediaContext(k);
|
|
7605
|
-
|
|
7605
|
+
Q(this, bt).set(e, $);
|
|
7606
7606
|
}
|
|
7607
7607
|
break;
|
|
7608
7608
|
// 视频媒体处理
|
|
7609
7609
|
case "video":
|
|
7610
7610
|
{
|
|
7611
7611
|
const $ = new VideoMediaContext(k);
|
|
7612
|
-
|
|
7612
|
+
Q(this, bt).set(e, $);
|
|
7613
7613
|
}
|
|
7614
7614
|
break;
|
|
7615
7615
|
}
|
|
@@ -7617,7 +7617,7 @@ class RoomMedias extends RoomBase {
|
|
|
7617
7617
|
const $ = this.getUserMediaStreamContext(u, E);
|
|
7618
7618
|
if ($ && $.kind === "audio")
|
|
7619
7619
|
try {
|
|
7620
|
-
const N =
|
|
7620
|
+
const N = Q(this, kt).get("audiooutput");
|
|
7621
7621
|
(O = $.audioContext) == null || O.setSinkId(N);
|
|
7622
7622
|
} catch (N) {
|
|
7623
7623
|
console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: setSinkId is error", N);
|
|
@@ -7629,21 +7629,21 @@ class RoomMedias extends RoomBase {
|
|
|
7629
7629
|
*/
|
|
7630
7630
|
Z(this, "getUserMediaStreamContext", (u, E) => {
|
|
7631
7631
|
const _ = this.getUserMediaKey(u, E);
|
|
7632
|
-
return
|
|
7632
|
+
return Q(this, bt).get(_);
|
|
7633
7633
|
});
|
|
7634
7634
|
/**
|
|
7635
7635
|
* 获取用户音频媒体流上下文
|
|
7636
7636
|
*/
|
|
7637
7637
|
Z(this, "getUserAudioMediaStreamContext", (u, E) => {
|
|
7638
7638
|
const _ = this.getUserMediaKey(u, E);
|
|
7639
|
-
return
|
|
7639
|
+
return Q(this, bt).get(_);
|
|
7640
7640
|
});
|
|
7641
7641
|
/**
|
|
7642
7642
|
* 删除用户媒体流上下文
|
|
7643
7643
|
*/
|
|
7644
7644
|
Z(this, "removeUserMediaStreamContext", (u, E) => {
|
|
7645
|
-
const _ = this.getUserMediaKey(u, E), k =
|
|
7646
|
-
k == null || k.stop(),
|
|
7645
|
+
const _ = this.getUserMediaKey(u, E), k = Q(this, bt).get(_);
|
|
7646
|
+
k == null || k.stop(), Q(this, bt).delete(_);
|
|
7647
7647
|
});
|
|
7648
7648
|
/**
|
|
7649
7649
|
* 获取某个用户的某个数据流
|
|
@@ -7676,16 +7676,16 @@ class RoomMedias extends RoomBase {
|
|
|
7676
7676
|
* 清除所有媒体流使用
|
|
7677
7677
|
*/
|
|
7678
7678
|
Z(this, "clearUserStreams", () => {
|
|
7679
|
-
const u =
|
|
7679
|
+
const u = Q(this, bt).values();
|
|
7680
7680
|
for (const E of u)
|
|
7681
7681
|
E.stop();
|
|
7682
|
-
|
|
7682
|
+
wt(this, bt, /* @__PURE__ */ new Map());
|
|
7683
7683
|
});
|
|
7684
7684
|
/**
|
|
7685
7685
|
* 设置轨道媒体参数
|
|
7686
7686
|
*/
|
|
7687
7687
|
Z(this, "setMediaTrackConstraints", async (u, E) => {
|
|
7688
|
-
|
|
7688
|
+
Q(this, dt).set(u, E);
|
|
7689
7689
|
const k = this.getUserStream(this.options.userId, u).getTracks();
|
|
7690
7690
|
if (k.length !== 0)
|
|
7691
7691
|
for (const e of k) {
|
|
@@ -7697,75 +7697,115 @@ class RoomMedias extends RoomBase {
|
|
|
7697
7697
|
* 初始化本地流
|
|
7698
7698
|
*/
|
|
7699
7699
|
Z(this, "initLocalStream", async (u) => {
|
|
7700
|
-
|
|
7701
|
-
|
|
7700
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: initLocalStream", u);
|
|
7701
|
+
const { userId: E } = this.options;
|
|
7702
|
+
switch (u) {
|
|
7702
7703
|
// 麦克风
|
|
7703
7704
|
case "microphoneCamera_audio":
|
|
7704
7705
|
{
|
|
7705
|
-
|
|
7706
|
+
this.removeUserMediaStreamContext(E, "microphoneCamera_audio");
|
|
7707
|
+
const _ = Q(this, kt).get("audioinput"), k = Q(this, dt).get("microphoneCamera_audio"), e = await navigator.mediaDevices.getUserMedia({ audio: { deviceId: _, ...k }, video: !1 });
|
|
7706
7708
|
await this.initUserMediaStreamContext(E, "microphoneCamera_audio", e);
|
|
7707
7709
|
}
|
|
7708
7710
|
break;
|
|
7709
7711
|
// 摄像头
|
|
7710
7712
|
case "microphoneCamera_video":
|
|
7711
7713
|
{
|
|
7712
|
-
|
|
7714
|
+
this.removeUserMediaStreamContext(E, "microphoneCamera_video");
|
|
7715
|
+
const _ = Q(this, kt).get("videoinput"), k = Q(this, dt).get("microphoneCamera_video"), e = await navigator.mediaDevices.getUserMedia({ audio: !1, video: { deviceId: _, ...k } });
|
|
7713
7716
|
await this.initUserMediaStreamContext(E, "microphoneCamera_video", e);
|
|
7714
7717
|
}
|
|
7715
7718
|
break;
|
|
7719
|
+
// 麦克风 + 摄像头
|
|
7720
|
+
case "microphoneCamera":
|
|
7721
|
+
{
|
|
7722
|
+
this.removeUserMediaStreamContext(E, "microphoneCamera_audio"), this.removeUserMediaStreamContext(E, "microphoneCamera_video");
|
|
7723
|
+
const _ = Q(this, kt).get("audioinput"), k = Q(this, kt).get("videoinput"), e = Q(this, dt).get("microphoneCamera_audio"), n = Q(this, dt).get("microphoneCamera_video"), O = await navigator.mediaDevices.getUserMedia({ audio: { deviceId: _, ...e }, video: { deviceId: k, ...n } });
|
|
7724
|
+
await this.initUserMediaStreamContext(E, "microphoneCamera_audio", O);
|
|
7725
|
+
}
|
|
7726
|
+
break;
|
|
7716
7727
|
// 屏幕共享 音频
|
|
7717
7728
|
case "screenSharing_audio":
|
|
7718
7729
|
{
|
|
7719
|
-
|
|
7730
|
+
this.removeUserMediaStreamContext(E, "screenSharing_audio");
|
|
7731
|
+
const _ = Q(this, dt).get("screenSharing_audio"), e = (await navigator.mediaDevices.getDisplayMedia({ audio: !0, video: !0, ..._ })).getTracks();
|
|
7720
7732
|
for (const n of e) {
|
|
7721
|
-
const { kind: O } = n
|
|
7722
|
-
|
|
7733
|
+
const { kind: O } = n;
|
|
7734
|
+
if (O === "audio") {
|
|
7735
|
+
const $ = new MediaStream();
|
|
7736
|
+
$.addTrack(n), await this.initUserMediaStreamContext(E, "screenSharing_audio", $);
|
|
7737
|
+
}
|
|
7723
7738
|
}
|
|
7724
7739
|
}
|
|
7725
7740
|
break;
|
|
7726
7741
|
// 屏幕共享 视频
|
|
7727
7742
|
case "screenSharing_video":
|
|
7728
7743
|
{
|
|
7729
|
-
|
|
7730
|
-
|
|
7744
|
+
this.removeUserMediaStreamContext(E, u);
|
|
7745
|
+
const _ = Q(this, dt).get(u), e = (await navigator.mediaDevices.getDisplayMedia({ audio: !1, video: !0, ..._ })).getTracks();
|
|
7746
|
+
for (const n of e) {
|
|
7747
|
+
const { kind: O } = n;
|
|
7748
|
+
if (O === "video") {
|
|
7749
|
+
const $ = new MediaStream();
|
|
7750
|
+
$.addTrack(n), await this.initUserMediaStreamContext(E, "screenSharing_video", $);
|
|
7751
|
+
}
|
|
7752
|
+
}
|
|
7753
|
+
}
|
|
7754
|
+
break;
|
|
7755
|
+
// 屏幕共享 音频+视频
|
|
7756
|
+
case "screenSharing":
|
|
7757
|
+
{
|
|
7758
|
+
this.removeUserMediaStreamContext(E, "screenSharing_audio"), this.removeUserMediaStreamContext(E, "screenSharing_video");
|
|
7759
|
+
const _ = Q(this, dt).get("screenSharing_audio"), k = Q(this, dt).get("screenSharing_video"), n = (await navigator.mediaDevices.getDisplayMedia({ audio: !0, video: !0, ..._, ...k })).getTracks();
|
|
7760
|
+
for (const O of n) {
|
|
7761
|
+
const { kind: $ } = O;
|
|
7762
|
+
if ($ === "audio") {
|
|
7763
|
+
const N = new MediaStream();
|
|
7764
|
+
N.addTrack(O), await this.initUserMediaStreamContext(E, "screenSharing_audio", N);
|
|
7765
|
+
}
|
|
7766
|
+
if ($ === "video") {
|
|
7767
|
+
const N = new MediaStream();
|
|
7768
|
+
N.addTrack(O), await this.initUserMediaStreamContext(E, "screenSharing_video", N);
|
|
7769
|
+
}
|
|
7770
|
+
}
|
|
7731
7771
|
}
|
|
7732
7772
|
break;
|
|
7733
7773
|
}
|
|
7734
7774
|
{
|
|
7735
|
-
const
|
|
7736
|
-
this.cwsIns.emitNotify("onLocalStream", { code: 200, data:
|
|
7775
|
+
const _ = this.getUserStreams(E);
|
|
7776
|
+
this.cwsIns.emitNotify("onLocalStream", { code: 200, data: _, desc: "local stream is change." }), this.emitNotifyUpdateUsersStreams([{ userId: E, updateStreams: { [u]: !0 } }]);
|
|
7737
7777
|
}
|
|
7738
7778
|
});
|
|
7739
7779
|
/**
|
|
7740
7780
|
* 获取媒体设备列表
|
|
7741
7781
|
*/
|
|
7742
7782
|
at(this, Tt, 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) => {
|
|
7743
|
-
|
|
7783
|
+
wt(this, $t, u);
|
|
7744
7784
|
}).catch(function(u) {
|
|
7745
7785
|
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: getEnumerateDevices is err", u);
|
|
7746
|
-
}),
|
|
7786
|
+
}), Q(this, $t)));
|
|
7747
7787
|
/**
|
|
7748
7788
|
* 媒体设备发生变化
|
|
7749
7789
|
*/
|
|
7750
7790
|
at(this, Ft, () => {
|
|
7751
7791
|
navigator.mediaDevices && (navigator.mediaDevices.ondevicechange = async () => {
|
|
7752
|
-
await
|
|
7753
|
-
}),
|
|
7792
|
+
await Q(this, Tt).call(this), this.cwsIns.emitNotify("onDevicechange", { code: 200, data: {}, desc: "device is change." });
|
|
7793
|
+
}), Q(this, Tt).call(this);
|
|
7754
7794
|
});
|
|
7755
7795
|
/**
|
|
7756
7796
|
* 获取正在使用的媒体设备ID
|
|
7757
7797
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
7758
7798
|
* @returns deviceId 设备ID
|
|
7759
7799
|
*/
|
|
7760
|
-
Z(this, "getMediaDeviceKind", (u) =>
|
|
7800
|
+
Z(this, "getMediaDeviceKind", (u) => Q(this, kt).get(u));
|
|
7761
7801
|
/**
|
|
7762
7802
|
* 设置正在使用的媒体设备
|
|
7763
7803
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
7764
7804
|
* @param deviceId 设备ID
|
|
7765
7805
|
*/
|
|
7766
7806
|
Z(this, "setDeviceKind", async (u, E) => {
|
|
7767
|
-
if (
|
|
7768
|
-
const _ =
|
|
7807
|
+
if (Q(this, kt).set(u, E), u === "audiooutput") {
|
|
7808
|
+
const _ = Q(this, bt).values();
|
|
7769
7809
|
for (const k of _)
|
|
7770
7810
|
k.kind === "audio" && "setSinkId" in HTMLMediaElement.prototype && k.audioContext.setSinkId(E);
|
|
7771
7811
|
}
|
|
@@ -7781,7 +7821,7 @@ class RoomMedias extends RoomBase {
|
|
|
7781
7821
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
7782
7822
|
* @returns MediaDeviceInfo[]
|
|
7783
7823
|
*/
|
|
7784
|
-
Z(this, "getEnumerateDevices", async (u) => (await
|
|
7824
|
+
Z(this, "getEnumerateDevices", async (u) => (await Q(this, Tt).call(this), Q(this, $t).filter((_) => _.kind === u)));
|
|
7785
7825
|
/**
|
|
7786
7826
|
* 获取可用音频输入设备
|
|
7787
7827
|
* @returns MediaDeviceInfo[]
|
|
@@ -7797,10 +7837,10 @@ class RoomMedias extends RoomBase {
|
|
|
7797
7837
|
* @returns MediaDeviceInfo[]
|
|
7798
7838
|
*/
|
|
7799
7839
|
Z(this, "getEnumerateVideoinputDevices", () => this.getEnumerateDevices("videoinput"));
|
|
7800
|
-
|
|
7840
|
+
Q(this, Ft).call(this), Q(this, Zt).call(this), Q(this, jt).call(this);
|
|
7801
7841
|
}
|
|
7802
7842
|
}
|
|
7803
|
-
$t = new WeakMap(),
|
|
7843
|
+
$t = new WeakMap(), kt = new WeakMap(), dt = new WeakMap(), bt = new WeakMap(), jt = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Ft = new WeakMap();
|
|
7804
7844
|
class RoomUsers extends RoomMedias {
|
|
7805
7845
|
constructor() {
|
|
7806
7846
|
super();
|
|
@@ -8127,28 +8167,28 @@ class RoomPeer extends RoomUsers {
|
|
|
8127
8167
|
// 网络抖动
|
|
8128
8168
|
});
|
|
8129
8169
|
Z(this, "initPeer", () => {
|
|
8130
|
-
this.peerIns = new RTCPeerConnection({ bundlePolicy: "max-bundle" }), this.transceiverMap = /* @__PURE__ */ new Map(),
|
|
8170
|
+
this.peerIns = new RTCPeerConnection({ bundlePolicy: "max-bundle" }), this.transceiverMap = /* @__PURE__ */ new Map(), Q(this, zt).call(this), Q(this, Wt).call(this);
|
|
8131
8171
|
});
|
|
8132
8172
|
// 初始化假数据流
|
|
8133
8173
|
at(this, Ht, () => {
|
|
8134
8174
|
for (const u of mediaType_keys)
|
|
8135
8175
|
switch (u) {
|
|
8136
8176
|
case "microphoneCamera_audio":
|
|
8137
|
-
|
|
8177
|
+
Q(this, St).set("microphoneCamera_audio", createMutedAudioStream());
|
|
8138
8178
|
break;
|
|
8139
8179
|
case "microphoneCamera_video":
|
|
8140
|
-
|
|
8180
|
+
Q(this, St).set("microphoneCamera_video", createFakeVideoStream());
|
|
8141
8181
|
break;
|
|
8142
8182
|
case "screenSharing_audio":
|
|
8143
|
-
|
|
8183
|
+
Q(this, St).set("screenSharing_audio", createMutedAudioStream());
|
|
8144
8184
|
break;
|
|
8145
8185
|
case "screenSharing_video":
|
|
8146
|
-
|
|
8186
|
+
Q(this, St).set("screenSharing_video", createFakeVideoStream());
|
|
8147
8187
|
break;
|
|
8148
8188
|
}
|
|
8149
8189
|
});
|
|
8150
8190
|
// 获取假数据流
|
|
8151
|
-
at(this, xt, (u) =>
|
|
8191
|
+
at(this, xt, (u) => Q(this, St).get(u));
|
|
8152
8192
|
/**
|
|
8153
8193
|
* 替换发射器媒体流
|
|
8154
8194
|
*/
|
|
@@ -8160,7 +8200,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8160
8200
|
let n;
|
|
8161
8201
|
if (e) {
|
|
8162
8202
|
const { sender: O } = e;
|
|
8163
|
-
E ? n = this.getUserStream(_, k) : n =
|
|
8203
|
+
E ? n = this.getUserStream(_, k) : n = Q(this, xt).call(this, k);
|
|
8164
8204
|
const [$] = n.getTracks();
|
|
8165
8205
|
O.replaceTrack($);
|
|
8166
8206
|
}
|
|
@@ -8189,7 +8229,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8189
8229
|
const E = [];
|
|
8190
8230
|
for (const _ of u) {
|
|
8191
8231
|
if (this.transceiverMap.has(_)) continue;
|
|
8192
|
-
const k =
|
|
8232
|
+
const k = Q(this, xt).call(this, _), [e] = k.getTracks(), n = this.peerIns.addTransceiver(e, { direction: "sendonly" });
|
|
8193
8233
|
this.transceiverMap.set(_, n), E.push(_);
|
|
8194
8234
|
}
|
|
8195
8235
|
if (u.length === 0 || E.length) {
|
|
@@ -8242,8 +8282,8 @@ class RoomPeer extends RoomUsers {
|
|
|
8242
8282
|
const { userId: q, mediaType: P } = D;
|
|
8243
8283
|
if (!q || !P) continue;
|
|
8244
8284
|
$.has(q) || $.set(q, { userId: q, tracks: [], updateStreams: {} });
|
|
8245
|
-
const
|
|
8246
|
-
|
|
8285
|
+
const V = $.get(q);
|
|
8286
|
+
V.tracks.push(D), V.updateStreams[P] = !0;
|
|
8247
8287
|
}
|
|
8248
8288
|
const N = [...$.values()];
|
|
8249
8289
|
for (const D of N) {
|
|
@@ -8252,7 +8292,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8252
8292
|
}
|
|
8253
8293
|
await this.emitNotifyUpdateUsersStreams(N), this.peerIns.removeEventListener("track", O), _(!0);
|
|
8254
8294
|
}, O = async ($) => {
|
|
8255
|
-
const { streams: N, transceiver: D } = $, [q] = N, { mid: P, receiver: j } = D, { track:
|
|
8295
|
+
const { streams: N, transceiver: D } = $, [q] = N, { mid: P, receiver: j } = D, { track: V } = j, { id: J, kind: z } = V, Y = k.find((nt) => nt.mid === `${P}`);
|
|
8256
8296
|
if (!Y) return;
|
|
8257
8297
|
const { userId: et, mediaType: tt } = Y;
|
|
8258
8298
|
if (!(!et || !tt)) {
|
|
@@ -8437,7 +8477,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8437
8477
|
lt && (e = lt), it && (n = it), st && (N += st), ct && (D += ct), rt && q.push((rt * 100).toFixed(2)), ot && P.push(ot.toFixed(2));
|
|
8438
8478
|
}
|
|
8439
8479
|
P.sort().reverse(), q.sort().reverse();
|
|
8440
|
-
const j = N - O,
|
|
8480
|
+
const j = N - O, V = D - $, J = j === 0 ? "0.00" : (V / j).toFixed(2), [z = "0"] = q, [Y = "0"] = P, et = { inboundBytes: e, outboundBytes: n, lostRate: J, roundTripTime: z, jitter: Y };
|
|
8441
8481
|
this.peerNetwork = et;
|
|
8442
8482
|
const tt = (nt, lt, it) => {
|
|
8443
8483
|
const st = Number(nt), ct = Number(lt), ot = Number(it);
|
|
@@ -8461,7 +8501,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8461
8501
|
*/
|
|
8462
8502
|
at(this, Wt, () => {
|
|
8463
8503
|
const u = async () => {
|
|
8464
|
-
this.peerIns.connectionState !== "connected" || !this.options.roomId ||
|
|
8504
|
+
this.peerIns.connectionState !== "connected" || !this.options.roomId || Q(this, Jt).call(this);
|
|
8465
8505
|
};
|
|
8466
8506
|
this.getPeerStatsTimer = setInterval(u, 1 * 1e3);
|
|
8467
8507
|
});
|
|
@@ -8469,7 +8509,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8469
8509
|
* 停止网络报告分析
|
|
8470
8510
|
*/
|
|
8471
8511
|
Z(this, "stopGetPeerStats", () => clearInterval(this.getPeerStatsTimer));
|
|
8472
|
-
|
|
8512
|
+
Q(this, Ht).call(this);
|
|
8473
8513
|
}
|
|
8474
8514
|
}
|
|
8475
8515
|
St = new WeakMap(), Ht = new WeakMap(), xt = new WeakMap(), zt = new WeakMap(), Jt = new WeakMap(), Wt = new WeakMap();
|
|
@@ -8488,19 +8528,21 @@ class RoomCalls extends RoomPeer {
|
|
|
8488
8528
|
*/
|
|
8489
8529
|
Z(this, "setLocalStream", (u, E) => new Promise(async (_, k) => {
|
|
8490
8530
|
try {
|
|
8491
|
-
this.setLocalStreamActiveMap.set(u, E);
|
|
8492
8531
|
const { userId: e } = this.options;
|
|
8493
|
-
|
|
8494
|
-
{
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
N.onended = () => this.stopPublish(["screenSharing_audio", "screenSharing_video"]);
|
|
8498
|
-
}
|
|
8499
|
-
{
|
|
8500
|
-
const $ = this.getUserStream(e, "screenSharing_video").getTracks();
|
|
8501
|
-
for (const N of $)
|
|
8502
|
-
N.onended = () => this.stopPublish(["screenSharing_audio", "screenSharing_video"]);
|
|
8532
|
+
for (const O of u)
|
|
8533
|
+
if (this.setLocalStreamActiveMap.set(O, E), E === !1) {
|
|
8534
|
+
this.removeUserMediaStreamContext(e, O);
|
|
8535
|
+
continue;
|
|
8503
8536
|
}
|
|
8537
|
+
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")) {
|
|
8538
|
+
const $ = this.getUserStream(e, "screenSharing_audio").getTracks();
|
|
8539
|
+
for (const N of $)
|
|
8540
|
+
N.onended = () => this.stopPublish(["screenSharing_audio"]);
|
|
8541
|
+
}
|
|
8542
|
+
if (u.includes("screenSharing_video")) {
|
|
8543
|
+
const $ = this.getUserStream(e, "screenSharing_video").getTracks();
|
|
8544
|
+
for (const N of $)
|
|
8545
|
+
N.onended = () => this.stopPublish(["screenSharing_video"]);
|
|
8504
8546
|
}
|
|
8505
8547
|
const n = this.getUserStreams(e);
|
|
8506
8548
|
_(n);
|
|
@@ -8568,8 +8610,8 @@ class RoomCalls extends RoomPeer {
|
|
|
8568
8610
|
}).then(async (D) => {
|
|
8569
8611
|
const { code: q = 0, desc: P = "服务器繁忙", data: j } = D;
|
|
8570
8612
|
if (q !== 200) return _(P);
|
|
8571
|
-
const { roomId:
|
|
8572
|
-
if (
|
|
8613
|
+
const { roomId: V = "", roomUsers: J = [] } = j;
|
|
8614
|
+
if (V !== O) return _("加入的房间不匹配");
|
|
8573
8615
|
this.createSession(), await this.updateUsers(J), e();
|
|
8574
8616
|
});
|
|
8575
8617
|
} catch (O) {
|
|
@@ -8632,27 +8674,25 @@ class RoomCalls extends RoomPeer {
|
|
|
8632
8674
|
Z(this, "publish", (u) => new Promise(async (E, _) => {
|
|
8633
8675
|
const k = async () => {
|
|
8634
8676
|
try {
|
|
8635
|
-
|
|
8636
|
-
const e = await this.getCaller(), n = [];
|
|
8677
|
+
await this.replaceSenderStream(u, !1), await this.createTrack(u);
|
|
8678
|
+
const e = await this.getCaller(), n = this.getSenderTracks(u), O = [...e.tracks, ...n];
|
|
8679
|
+
await this.updateUsertracks(e.id, O, !0);
|
|
8680
|
+
const $ = await this.getCallAction(O);
|
|
8681
|
+
await Q(this, It).call(this, $), await this.replaceSenderStream(u, !0), Q(this, Kt).call(this, u);
|
|
8682
|
+
try {
|
|
8683
|
+
await this.setLocalStream(u, !0);
|
|
8684
|
+
} catch {
|
|
8685
|
+
}
|
|
8686
|
+
const N = [];
|
|
8637
8687
|
for (const D of u)
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
await this.setLocalStream(D, !0);
|
|
8641
|
-
} catch (j) {
|
|
8642
|
-
n.push(D), console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: setLocalStream is error.", j);
|
|
8643
|
-
}
|
|
8644
|
-
const O = this.getSenderTracks(u), $ = [...e.tracks, ...O];
|
|
8645
|
-
await this.updateUsertracks(e.id, $, !0);
|
|
8646
|
-
const N = await this.getCallAction($);
|
|
8647
|
-
await V(this, It).call(this, N), await this.replaceSenderStream(u, !0), V(this, Kt).call(this, u), await this.inactiveTracks(n, !1);
|
|
8688
|
+
this.getUserStream(e.id, D).getTracks().length === 0 && N.push(D);
|
|
8689
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: inactive_mediaTypes", N), N.length !== 0 && await this.inactiveTracks(N, !1);
|
|
8648
8690
|
{
|
|
8649
8691
|
await this.emitNotifyUpdateUsers();
|
|
8650
8692
|
const D = await this.getCaller();
|
|
8651
8693
|
E(D);
|
|
8652
8694
|
}
|
|
8653
8695
|
} catch (e) {
|
|
8654
|
-
for (const n of u)
|
|
8655
|
-
await this.setLocalStream(n, !1);
|
|
8656
8696
|
_(`publish is error: ${e.message || e}`);
|
|
8657
8697
|
}
|
|
8658
8698
|
};
|
|
@@ -8679,7 +8719,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8679
8719
|
await this.replaceSenderStream(u, !0), await this.removeSenders(u), await this.closeUserTracks(e.id, n, !0);
|
|
8680
8720
|
{
|
|
8681
8721
|
const $ = await this.getCallAction(e.tracks);
|
|
8682
|
-
await
|
|
8722
|
+
await Q(this, It).call(this, $);
|
|
8683
8723
|
}
|
|
8684
8724
|
await this.createOffer(), await this.cwsIns.sendMessage({
|
|
8685
8725
|
event: "closeTrack",
|
|
@@ -8710,8 +8750,8 @@ class RoomCalls extends RoomPeer {
|
|
|
8710
8750
|
for (const q of n) {
|
|
8711
8751
|
const { isSelf: P, tracks: j = [] } = q;
|
|
8712
8752
|
if (!P) {
|
|
8713
|
-
const
|
|
8714
|
-
|
|
8753
|
+
const V = j.filter(({ trackName: J, mid: z = "" }) => z !== "" && (u.includes(J) || u.length === 0));
|
|
8754
|
+
V.length !== 0 && O.push({ ...q, tracks: V });
|
|
8715
8755
|
}
|
|
8716
8756
|
}
|
|
8717
8757
|
const $ = async () => {
|
|
@@ -8721,7 +8761,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8721
8761
|
if (O.length === 0) return $();
|
|
8722
8762
|
const N = [];
|
|
8723
8763
|
for (const q of O) {
|
|
8724
|
-
const { id: P, tracks: j } = q,
|
|
8764
|
+
const { id: P, tracks: j } = q, V = ft(j, ["type", "trackName"]), J = { id: P, tracks: V };
|
|
8725
8765
|
N.push(J);
|
|
8726
8766
|
}
|
|
8727
8767
|
const D = async () => {
|
|
@@ -8729,11 +8769,11 @@ class RoomCalls extends RoomPeer {
|
|
|
8729
8769
|
event: "subscribe",
|
|
8730
8770
|
data: { users: N }
|
|
8731
8771
|
}).then(async (q) => {
|
|
8732
|
-
const { code: P = 0, data: j, desc:
|
|
8772
|
+
const { code: P = 0, data: j, desc: V } = q;
|
|
8733
8773
|
if (P !== 200) {
|
|
8734
8774
|
if (E > 0)
|
|
8735
8775
|
return await new Promise((Y) => setTimeout(() => Y(!0), 300)), E = E - 1, D();
|
|
8736
|
-
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(
|
|
8776
|
+
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);
|
|
8737
8777
|
}
|
|
8738
8778
|
const { remoteSdp: J, users: z = [] } = j;
|
|
8739
8779
|
this.onSubscribeUserTracks(z).then(async () => {
|
|
@@ -8761,8 +8801,8 @@ class RoomCalls extends RoomPeer {
|
|
|
8761
8801
|
for (const $ of e) {
|
|
8762
8802
|
const { tracks: N = [] } = $;
|
|
8763
8803
|
for (const D of N) {
|
|
8764
|
-
const { type: q, mid: P, trackName: j, mediaType:
|
|
8765
|
-
if (!(!
|
|
8804
|
+
const { type: q, mid: P, trackName: j, mediaType: V, msid: J } = D;
|
|
8805
|
+
if (!(!V || !J) && (u.length === 0 || u.includes(j))) {
|
|
8766
8806
|
const z = { type: q, mid: P, trackName: J };
|
|
8767
8807
|
n.push(z), await this.closeUserTracks($.id, [D]);
|
|
8768
8808
|
}
|
|
@@ -8806,7 +8846,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8806
8846
|
}
|
|
8807
8847
|
}
|
|
8808
8848
|
const O = await this.getCallAction(n);
|
|
8809
|
-
await
|
|
8849
|
+
await Q(this, It).call(this, O), await this.emitNotifyUpdateUsers(), _(!0);
|
|
8810
8850
|
}));
|
|
8811
8851
|
/**
|
|
8812
8852
|
* 远端调试
|
|
@@ -9037,13 +9077,13 @@ class QuickVO extends Room {
|
|
|
9037
9077
|
*/
|
|
9038
9078
|
Z(this, "addRequestAnimationFrame", async (u, E) => {
|
|
9039
9079
|
{
|
|
9040
|
-
const k =
|
|
9080
|
+
const k = Q(this, gt).get(u);
|
|
9041
9081
|
k && cancelAnimationFrame(k);
|
|
9042
9082
|
}
|
|
9043
9083
|
const _ = (k = Date.now()) => {
|
|
9044
9084
|
E(k);
|
|
9045
9085
|
const e = requestAnimationFrame(_);
|
|
9046
|
-
|
|
9086
|
+
Q(this, gt).set(u, e);
|
|
9047
9087
|
};
|
|
9048
9088
|
_();
|
|
9049
9089
|
});
|
|
@@ -9052,10 +9092,10 @@ class QuickVO extends Room {
|
|
|
9052
9092
|
* @param keys string[] = []
|
|
9053
9093
|
*/
|
|
9054
9094
|
Z(this, "clearRequestAnimationFrame", async (u = []) => {
|
|
9055
|
-
u.length === 0 && (u = [...
|
|
9095
|
+
u.length === 0 && (u = [...Q(this, gt).keys()]);
|
|
9056
9096
|
const E = [];
|
|
9057
9097
|
for (const _ of u) {
|
|
9058
|
-
const k =
|
|
9098
|
+
const k = Q(this, gt).get(_);
|
|
9059
9099
|
k && (cancelAnimationFrame(k), E.push(k));
|
|
9060
9100
|
}
|
|
9061
9101
|
return E;
|
|
@@ -9067,7 +9107,7 @@ class QuickVO extends Room {
|
|
|
9067
9107
|
Z(this, "destroy", async () => {
|
|
9068
9108
|
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();
|
|
9069
9109
|
});
|
|
9070
|
-
this.setOptions(u), this.initCwsCall(),
|
|
9110
|
+
this.setOptions(u), this.initCwsCall(), Q(this, Qt).call(this), Q(this, Vt).call(this), Q(this, Yt).call(this), Q(this, Gt).call(this);
|
|
9071
9111
|
}
|
|
9072
9112
|
}
|
|
9073
9113
|
gt = new WeakMap(), Gt = new WeakMap(), Qt = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap();
|