quickvo-sdk-js 0.4.5 → 0.4.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 +17 -17
- package/dist/index.umd.cjs +1 -1
- package/dist/room/RoomBase.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7350,9 +7350,9 @@ class CallsWebSocket {
|
|
|
7350
7350
|
}
|
|
7351
7351
|
}
|
|
7352
7352
|
yt = new WeakMap(), lt = new WeakMap(), gt = new WeakMap(), ft = new WeakMap(), dt = new WeakMap(), Et = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), At = new WeakMap(), $t = new WeakMap(), qt = new WeakMap(), Dt = new WeakMap(), Ct = new WeakMap();
|
|
7353
|
-
var p = Object.defineProperty,
|
|
7353
|
+
var p = Object.defineProperty, y = (_) => {
|
|
7354
7354
|
throw TypeError(_);
|
|
7355
|
-
}, g = (_, q, k) => q in _ ? p(_, q, { enumerable: !0, configurable: !0, writable: !0, value: k }) : _[q] = k, h = (_, q, k) => g(_, typeof q != "symbol" ? q + "" : q, k),
|
|
7355
|
+
}, g = (_, q, k) => q in _ ? p(_, q, { enumerable: !0, configurable: !0, writable: !0, value: k }) : _[q] = k, h = (_, q, k) => g(_, typeof q != "symbol" ? q + "" : q, k), x = (_, q, k) => q.has(_) || y("Cannot " + k), n = (_, q, k) => (x(_, q, "read from private field"), k ? k.call(_) : q.get(_)), f = (_, q, k) => q.has(_) ? y("Cannot add the same private member more than once") : q instanceof WeakSet ? q.add(_) : q.set(_, k), b = (_, q, k, D) => (x(_, q, "write to private field"), q.set(_, k), k), a, o, d;
|
|
7356
7356
|
class K {
|
|
7357
7357
|
// 任务 index
|
|
7358
7358
|
/**
|
|
@@ -7361,8 +7361,8 @@ class K {
|
|
|
7361
7361
|
* @param conditionKeys 条件keys string[]
|
|
7362
7362
|
*/
|
|
7363
7363
|
constructor(q) {
|
|
7364
|
-
|
|
7365
|
-
n(this,
|
|
7364
|
+
f(this, a, /* @__PURE__ */ new Map()), f(this, o, []), h(this, "index"), h(this, "setCondition", (k, D) => {
|
|
7365
|
+
n(this, a).set(k, D), D && n(this, d).call(this);
|
|
7366
7366
|
}), h(this, "addTask", (k, D, $ = {}) => {
|
|
7367
7367
|
const I = { key: "", strict: !1, describe: "", ...$ };
|
|
7368
7368
|
let { key: e, strict: u, describe: N } = I;
|
|
@@ -7371,7 +7371,7 @@ class K {
|
|
|
7371
7371
|
const A = { key: e, func: k, conditionKeys: D, describe: N, strict: u };
|
|
7372
7372
|
n(this, o).unshift(A);
|
|
7373
7373
|
}
|
|
7374
|
-
return n(this,
|
|
7374
|
+
return n(this, d).call(this), e;
|
|
7375
7375
|
}), h(this, "clear", (k = []) => {
|
|
7376
7376
|
if (k.length === 0) {
|
|
7377
7377
|
b(this, o, []);
|
|
@@ -7381,7 +7381,7 @@ class K {
|
|
|
7381
7381
|
const $ = n(this, o).findIndex((I) => I.key === D);
|
|
7382
7382
|
$ !== -1 && n(this, o).splice($, 1);
|
|
7383
7383
|
}
|
|
7384
|
-
}), h(this, "getConditions", () => Object.fromEntries(n(this,
|
|
7384
|
+
}), h(this, "getConditions", () => Object.fromEntries(n(this, a))), h(this, "getTasks", () => {
|
|
7385
7385
|
const k = [];
|
|
7386
7386
|
for (const D of n(this, o)) {
|
|
7387
7387
|
const { key: $, describe: I, conditionKeys: e } = D;
|
|
@@ -7391,18 +7391,18 @@ class K {
|
|
|
7391
7391
|
}), h(this, "checkConditions", (k) => {
|
|
7392
7392
|
let D = !0;
|
|
7393
7393
|
for (const $ of k)
|
|
7394
|
-
if (n(this,
|
|
7394
|
+
if (n(this, a).get($) === !1) {
|
|
7395
7395
|
D = !1;
|
|
7396
7396
|
break;
|
|
7397
7397
|
}
|
|
7398
7398
|
return D;
|
|
7399
|
-
}),
|
|
7399
|
+
}), f(this, d, async () => {
|
|
7400
7400
|
const k = n(this, o).length;
|
|
7401
7401
|
for (let D = k; D > 0; D--) {
|
|
7402
7402
|
const $ = D - 1, I = n(this, o)[$], { conditionKeys: e, func: u, strict: N } = I, A = this.checkConditions(e);
|
|
7403
7403
|
{
|
|
7404
7404
|
if (!A) return;
|
|
7405
|
-
u();
|
|
7405
|
+
await u();
|
|
7406
7406
|
}
|
|
7407
7407
|
{
|
|
7408
7408
|
if (N) return;
|
|
@@ -7411,10 +7411,10 @@ class K {
|
|
|
7411
7411
|
}
|
|
7412
7412
|
}), this.index = 0;
|
|
7413
7413
|
for (const k of q)
|
|
7414
|
-
n(this,
|
|
7414
|
+
n(this, a).set(k, !1);
|
|
7415
7415
|
}
|
|
7416
7416
|
}
|
|
7417
|
-
|
|
7417
|
+
a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap();
|
|
7418
7418
|
class RoomBase {
|
|
7419
7419
|
constructor() {
|
|
7420
7420
|
H(this, "options", {
|
|
@@ -7430,7 +7430,7 @@ class RoomBase {
|
|
|
7430
7430
|
// 是否禁止通知
|
|
7431
7431
|
H(this, "isEarly", !1);
|
|
7432
7432
|
// 是否提前建连
|
|
7433
|
-
H(this, "taskQueue", new K(["createWs", "createSession", "ice", "joinRoom", "createTrack", "subscribe", "closeTrack"
|
|
7433
|
+
H(this, "taskQueue", new K(["createWs", "createSession", "ice", "joinRoom", "createTrack", "subscribe", "closeTrack"]));
|
|
7434
7434
|
// 条件队列
|
|
7435
7435
|
H(this, "roomState", "ready");
|
|
7436
7436
|
// 房间状态
|
|
@@ -7450,7 +7450,7 @@ class RoomBase {
|
|
|
7450
7450
|
screenSharing_audio: ""
|
|
7451
7451
|
});
|
|
7452
7452
|
H(this, "initAsyncQueue", () => {
|
|
7453
|
-
this.taskQueue.clear(), this.taskQueue.setCondition("joinRoom", !0), this.taskQueue.setCondition("createTrack", !0), this.taskQueue.setCondition("closeTrack", !0), this.taskQueue.setCondition("subscribe", !0)
|
|
7453
|
+
this.taskQueue.clear(), this.taskQueue.setCondition("joinRoom", !0), this.taskQueue.setCondition("createTrack", !0), this.taskQueue.setCondition("closeTrack", !0), this.taskQueue.setCondition("subscribe", !0);
|
|
7454
7454
|
});
|
|
7455
7455
|
/**
|
|
7456
7456
|
* 获取房间信息
|
|
@@ -8592,7 +8592,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8592
8592
|
H(this, "publish", (k) => new Promise(async (D, $) => {
|
|
8593
8593
|
const I = async () => {
|
|
8594
8594
|
try {
|
|
8595
|
-
|
|
8595
|
+
k.includes("screenSharing_audio") && !k.includes("screenSharing_video") && (k = [...k, "screenSharing_video"]), await this.replaceSenderStream(k, !1);
|
|
8596
8596
|
const e = await this.getCaller();
|
|
8597
8597
|
for (const L of k)
|
|
8598
8598
|
this.getUserStream(e.id, L).getTracks().length === 0 && await this.setLocalStream(L, !0);
|
|
@@ -8605,16 +8605,16 @@ class RoomCalls extends RoomPeer {
|
|
|
8605
8605
|
{
|
|
8606
8606
|
await this.emitNotifyUpdateUsers();
|
|
8607
8607
|
const L = await this.getCaller();
|
|
8608
|
-
|
|
8608
|
+
D(L);
|
|
8609
8609
|
}
|
|
8610
8610
|
} catch (e) {
|
|
8611
8611
|
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: error", e);
|
|
8612
8612
|
for (const u of k)
|
|
8613
8613
|
await this.setLocalStream(u, !1);
|
|
8614
|
-
|
|
8614
|
+
$(`publish is error: ${e.message || e}`);
|
|
8615
8615
|
}
|
|
8616
8616
|
};
|
|
8617
|
-
this.taskQueue.addTask(I, ["createWs", "createSession", "ice", "createTrack", "subscribe"
|
|
8617
|
+
this.taskQueue.addTask(I, ["createWs", "createSession", "ice", "createTrack", "subscribe"], { describe: "replaceSenderStream" });
|
|
8618
8618
|
}));
|
|
8619
8619
|
/**
|
|
8620
8620
|
* 停止发布流
|