quickvo-sdk-js 0.4.6 → 0.4.8
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 +34 -26
- package/dist/index.umd.cjs +1 -1
- package/dist/room/RoomCalls.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, x = (_) => {
|
|
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), y = (_, q, k) => q.has(_) || x("Cannot " + k), n = (_, q, k) => (y(_, q, "read from private field"), k ? k.call(_) : q.get(_)), a = (_, q, k) => q.has(_) ? x("Cannot add the same private member more than once") : q instanceof WeakSet ? q.add(_) : q.set(_, k), b = (_, q, k, D) => (y(_, q, "write to private field"), q.set(_, k), k), d, o, f;
|
|
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
|
+
a(this, d, /* @__PURE__ */ new Map()), a(this, o, []), h(this, "index"), h(this, "setCondition", (k, D) => {
|
|
7365
|
+
n(this, d).set(k, D), D && n(this, f).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, f).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, d))), 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, d).get($) === !1) {
|
|
7395
7395
|
D = !1;
|
|
7396
7396
|
break;
|
|
7397
7397
|
}
|
|
7398
7398
|
return D;
|
|
7399
|
-
}),
|
|
7399
|
+
}), a(this, f, () => {
|
|
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
|
-
|
|
7405
|
+
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, d).set(k, !1);
|
|
7415
7415
|
}
|
|
7416
7416
|
}
|
|
7417
|
-
|
|
7417
|
+
d = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap();
|
|
7418
7418
|
class RoomBase {
|
|
7419
7419
|
constructor() {
|
|
7420
7420
|
H(this, "options", {
|
|
@@ -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("createSession", !0), this.taskQueue.setCondition("ice", !0), 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
|
* 获取房间信息
|
|
@@ -8262,7 +8262,7 @@ class RoomPeer extends RoomUsers {
|
|
|
8262
8262
|
};
|
|
8263
8263
|
this.peerIns.onconnectionstatechange = () => {
|
|
8264
8264
|
const $ = this.peerIns.connectionState;
|
|
8265
|
-
switch (clearTimeout(k),
|
|
8265
|
+
switch (clearTimeout(k), $) {
|
|
8266
8266
|
// 连接完成
|
|
8267
8267
|
case "connected":
|
|
8268
8268
|
this.taskQueue.setCondition("ice", !0), this.options.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#00b60f;", `------->quickvo: connectionState:${$}`);
|
|
@@ -8825,19 +8825,27 @@ class RoomCalls extends RoomPeer {
|
|
|
8825
8825
|
/**
|
|
8826
8826
|
* 创建cf会话
|
|
8827
8827
|
*/
|
|
8828
|
-
H(this, "createSession", () =>
|
|
8829
|
-
if (["connecting", "connected"].includes(this.roomState))
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8828
|
+
H(this, "createSession", () => {
|
|
8829
|
+
if (!["connecting", "connected"].includes(this.roomState))
|
|
8830
|
+
return this.setRoomState("connecting"), new Promise((k) => {
|
|
8831
|
+
const D = async () => {
|
|
8832
|
+
try {
|
|
8833
|
+
this.taskQueue.setCondition("createSession", !1), await this.addSenders(), await this.cwsIns.sendMessage({
|
|
8834
|
+
event: "connectCF",
|
|
8835
|
+
data: { sdp: this.getSdp() }
|
|
8836
|
+
}).then(async ($) => {
|
|
8837
|
+
const { code: I = 0, desc: e, data: u } = $;
|
|
8838
|
+
if (I !== 200) throw new Error(e);
|
|
8839
|
+
const { remoteSdp: N } = u;
|
|
8840
|
+
this.taskQueue.setCondition("ice", !1), await this.setRemoteDescription({ type: "answer", sdp: N }), this.taskQueue.setCondition("createSession", !0), k(!0);
|
|
8841
|
+
});
|
|
8842
|
+
} catch ($) {
|
|
8843
|
+
this.taskQueue.setCondition("createSession", !0), console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo create session is error.", $);
|
|
8844
|
+
}
|
|
8845
|
+
};
|
|
8846
|
+
this.taskQueue.addTask(D, ["createWs", "createSession", "ice"], { key: "createSession", describe: "createSession" });
|
|
8847
|
+
});
|
|
8848
|
+
});
|
|
8841
8849
|
/**
|
|
8842
8850
|
* 创建媒体轨道
|
|
8843
8851
|
*/
|