quickvo-sdk-js 0.4.0 → 0.4.2
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/README.md +4 -0
- package/dist/index.js +22 -15
- package/dist/index.umd.cjs +2 -2
- package/dist/room/RoomBase.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
本节介绍实现音视频互动的主体流程及必用的 API,SDK 提供的其他能力可参考“通信能力、房间能力、音频/视频能力”的相关功能点描述 
|
|
19
19
|
|
|
20
|
+
## 在线演示
|
|
21
|
+
|
|
22
|
+
[开发环境](https://dev-meet.quickvo.live) / [测试环境](https://test-meet.quickvo.live)
|
|
23
|
+
|
|
20
24
|
## 说明
|
|
21
25
|
|
|
22
26
|
- 以下为快速接入并体验基本功能,如需要更详细的控制和使用请查阅 完整 api 章节。
|
package/dist/index.js
CHANGED
|
@@ -7423,7 +7423,7 @@ class RoomBase {
|
|
|
7423
7423
|
// 是否禁止通知
|
|
7424
7424
|
F(this, "isEarly", !1);
|
|
7425
7425
|
// 是否提前建连
|
|
7426
|
-
F(this, "taskQueue", new j(["createWs", "createSession", "ice", "createTrack", "subscribe", "closeTrack"]));
|
|
7426
|
+
F(this, "taskQueue", new j(["createWs", "createSession", "ice", "createTrack", "subscribe", "closeTrack", "publish"]));
|
|
7427
7427
|
// 条件队列
|
|
7428
7428
|
F(this, "roomState", "ready");
|
|
7429
7429
|
// 房间状态
|
|
@@ -7443,7 +7443,7 @@ class RoomBase {
|
|
|
7443
7443
|
screenSharing_audio: ""
|
|
7444
7444
|
});
|
|
7445
7445
|
F(this, "initAsyncQueue", () => {
|
|
7446
|
-
this.taskQueue.clear(), this.taskQueue.setCondition("createTrack", !0), this.taskQueue.setCondition("closeTrack", !0), this.taskQueue.setCondition("subscribe", !0);
|
|
7446
|
+
this.taskQueue.clear(), this.taskQueue.setCondition("createTrack", !0), this.taskQueue.setCondition("closeTrack", !0), this.taskQueue.setCondition("subscribe", !0), this.taskQueue.setCondition("publish", !0);
|
|
7447
7447
|
});
|
|
7448
7448
|
/**
|
|
7449
7449
|
* 获取房间信息
|
|
@@ -8582,7 +8582,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8582
8582
|
F(this, "publish", (_) => new Promise(async (q, k) => {
|
|
8583
8583
|
const $ = async () => {
|
|
8584
8584
|
try {
|
|
8585
|
-
_.includes("screenSharing_audio") && !_.includes("screenSharing_video") && (_ = [..._, "screenSharing_video"]), await this.replaceSenderStream(_, !1);
|
|
8585
|
+
this.taskQueue.setCondition("publish", !1), _.includes("screenSharing_audio") && !_.includes("screenSharing_video") && (_ = [..._, "screenSharing_video"]), await this.replaceSenderStream(_, !1);
|
|
8586
8586
|
const e = await this.getCaller();
|
|
8587
8587
|
for (const P of _)
|
|
8588
8588
|
this.getUserStream(e.id, P).getTracks().length === 0 && await this.setLocalStream(P, !0);
|
|
@@ -8595,16 +8595,16 @@ class RoomCalls extends RoomPeer {
|
|
|
8595
8595
|
{
|
|
8596
8596
|
await this.emitNotifyUpdateUsers();
|
|
8597
8597
|
const P = await this.getCaller();
|
|
8598
|
-
q(P);
|
|
8598
|
+
this.taskQueue.setCondition("publish", !0), q(P);
|
|
8599
8599
|
}
|
|
8600
8600
|
} catch (e) {
|
|
8601
8601
|
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: error", e);
|
|
8602
8602
|
for (const o of _)
|
|
8603
8603
|
await this.setLocalStream(o, !1);
|
|
8604
|
-
k(`publish is error: ${e.message || e}`);
|
|
8604
|
+
this.taskQueue.setCondition("publish", !0), k(`publish is error: ${e.message || e}`);
|
|
8605
8605
|
}
|
|
8606
8606
|
};
|
|
8607
|
-
this.taskQueue.addTask($, ["createWs", "createSession", "ice", "createTrack", "subscribe"], { describe: "publish" });
|
|
8607
|
+
this.taskQueue.addTask($, ["createWs", "createSession", "ice", "createTrack", "subscribe", "publish"], { describe: "publish" });
|
|
8608
8608
|
}));
|
|
8609
8609
|
/**
|
|
8610
8610
|
* 停止发布流
|
|
@@ -8816,7 +8816,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8816
8816
|
* 创建cf会话
|
|
8817
8817
|
*/
|
|
8818
8818
|
F(this, "createSession", () => new Promise((_) => {
|
|
8819
|
-
const q = async () => ["connecting", "connected"].includes(this.roomState) ? _(!0) : (this.setRoomState("connecting"), this.taskQueue.setCondition("createSession", !1), await this.addSenders(), this.cwsIns.sendMessage({
|
|
8819
|
+
const q = async () => ["connecting", "connected"].includes(this.roomState) ? _(!0) : (this.setRoomState("connecting"), this.taskQueue.setCondition("ice", !1), this.taskQueue.setCondition("createSession", !1), await this.addSenders(), this.cwsIns.sendMessage({
|
|
8820
8820
|
event: "connectCF",
|
|
8821
8821
|
data: { sdp: this.getSdp() }
|
|
8822
8822
|
}).then(async (k) => {
|
|
@@ -8905,16 +8905,23 @@ class QuickVO extends Room {
|
|
|
8905
8905
|
}
|
|
8906
8906
|
{
|
|
8907
8907
|
const _ = async (q) => {
|
|
8908
|
-
|
|
8908
|
+
const { user: k } = q.data, { id: $, tracks: e = [] } = k;
|
|
8909
|
+
await this.updateUserPermissions($, 3);
|
|
8910
|
+
const o = [];
|
|
8909
8911
|
{
|
|
8910
|
-
const
|
|
8911
|
-
|
|
8912
|
+
const { tracks: I } = await this.getUser($);
|
|
8913
|
+
for (const N of e) {
|
|
8914
|
+
const { mid: D, trackName: P } = N;
|
|
8915
|
+
if (I.find((L) => L.mid === D && L.trackName === P)) continue;
|
|
8916
|
+
o.push(N);
|
|
8917
|
+
}
|
|
8912
8918
|
}
|
|
8913
|
-
if (
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8919
|
+
if (o.length !== 0)
|
|
8920
|
+
if (await this.updateUsertracks($, o, !0), this.options.newPublishAutoSubscribe) {
|
|
8921
|
+
const I = this.getTrackNamesFormTracks(o);
|
|
8922
|
+
await this.subscribe(I);
|
|
8923
|
+
} else
|
|
8924
|
+
await this.emitNotifyUpdateUsers();
|
|
8918
8925
|
};
|
|
8919
8926
|
this.cwsIns.addNotify({ event: "onPublish", callback: _ }, !0);
|
|
8920
8927
|
}
|