quickvo-sdk-js 0.5.1 → 0.5.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 +18 -18
- package/dist/index.umd.cjs +1 -1
- package/dist/room/RoomBase.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7425,6 +7425,7 @@ class RoomBase {
|
|
|
7425
7425
|
debug: !1,
|
|
7426
7426
|
newPublishAutoSubscribe: !0
|
|
7427
7427
|
});
|
|
7428
|
+
Z(this, "localStreamActiveMap", /* @__PURE__ */ new Map());
|
|
7428
7429
|
Z(this, "prohibitNotify", !1);
|
|
7429
7430
|
// 是否禁止通知
|
|
7430
7431
|
Z(this, "isEarly", !1);
|
|
@@ -7546,7 +7547,7 @@ class RoomBase {
|
|
|
7546
7547
|
/**
|
|
7547
7548
|
* 处理为应用层数据
|
|
7548
7549
|
*/
|
|
7549
|
-
Z(this, "usersFilter", (I) => ft(I, ["id", "isSelf", "joinTime", "tracks", "callAction", "callActionStr", "callActionMap", "network", "
|
|
7550
|
+
Z(this, "usersFilter", (I) => ft(I, ["id", "isSelf", "joinTime", "tracks", "callAction", "callActionStr", "callActionMap", "network", "permissions", "isPublished", "updateStreams"]).sort((_, k) => _.id.localeCompare(k.id, "en")));
|
|
7550
7551
|
this.initAsyncQueue();
|
|
7551
7552
|
}
|
|
7552
7553
|
}
|
|
@@ -7766,9 +7767,8 @@ class RoomMedias extends RoomBase {
|
|
|
7766
7767
|
break;
|
|
7767
7768
|
}
|
|
7768
7769
|
{
|
|
7769
|
-
this.emitNotifyUpdateUsersStreams([{ userId: E, updateStreams: { [u]: !0 } }]);
|
|
7770
7770
|
const k = this.getUserStreams(E);
|
|
7771
|
-
this.cwsIns.emitNotify("onLocalStream", { code: 200, data: k, desc: "local stream is change." });
|
|
7771
|
+
this.cwsIns.emitNotify("onLocalStream", { code: 200, data: k, desc: "local stream is change." }), this.emitNotifyUpdateUsersStreams([{ userId: E, updateStreams: { [u]: !0 } }]);
|
|
7772
7772
|
}
|
|
7773
7773
|
});
|
|
7774
7774
|
/**
|
|
@@ -8153,15 +8153,10 @@ class RoomPeer extends RoomUsers {
|
|
|
8153
8153
|
*/
|
|
8154
8154
|
Z(this, "setMediaDeviceKind", async (u, E) => {
|
|
8155
8155
|
await this.setDeviceKind(u, E);
|
|
8156
|
-
const _ = await this.getCaller(), {
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
break;
|
|
8161
|
-
case "videoinput":
|
|
8162
|
-
this.getUserMediaStreamContext(k, "microphoneCamera_video") && await this.initLocalStream("microphoneCamera_video"), e.find(($) => $.mediaType === "microphoneCamera_video") && await this.replaceSenderStream(["microphoneCamera_video"], !0);
|
|
8163
|
-
break;
|
|
8164
|
-
}
|
|
8156
|
+
const _ = await this.getCaller(), { tracks: k = [] } = _, e = async (n) => {
|
|
8157
|
+
this.localStreamActiveMap.get(n) && await this.initLocalStream(n), k.find(($) => $.mediaType === n) && await this.replaceSenderStream([n], !0);
|
|
8158
|
+
};
|
|
8159
|
+
u === "audioinput" && await e("microphoneCamera_audio"), u === "videoinput" && await e("microphoneCamera_video");
|
|
8165
8160
|
});
|
|
8166
8161
|
/**
|
|
8167
8162
|
* 替换发射器媒体流
|
|
@@ -8502,7 +8497,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8502
8497
|
Z(this, "setLocalStream", (u, E) => new Promise(async (_, k) => {
|
|
8503
8498
|
try {
|
|
8504
8499
|
const { userId: e } = this.options;
|
|
8505
|
-
if (E ? await this.initLocalStream(u) : this.removeUserMediaStreamContext(e, u), u === "screenSharing_audio" || u === "screenSharing_video") {
|
|
8500
|
+
if (E ? (this.localStreamActiveMap.set(u, !0), await this.initLocalStream(u)) : (this.localStreamActiveMap.set(u, !1), this.removeUserMediaStreamContext(e, u)), u === "screenSharing_audio" || u === "screenSharing_video") {
|
|
8506
8501
|
{
|
|
8507
8502
|
const $ = this.getUserStream(e, "screenSharing_audio").getTracks();
|
|
8508
8503
|
for (const N of $)
|
|
@@ -8515,7 +8510,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8515
8510
|
}
|
|
8516
8511
|
}
|
|
8517
8512
|
const n = this.getUserStreams(e);
|
|
8518
|
-
|
|
8513
|
+
_(n);
|
|
8519
8514
|
} catch (e) {
|
|
8520
8515
|
k(e);
|
|
8521
8516
|
}
|
|
@@ -8628,13 +8623,18 @@ class RoomCalls extends RoomPeer {
|
|
|
8628
8623
|
u.includes("screenSharing_audio") && !u.includes("screenSharing_video") && (u = [...u, "screenSharing_video"]);
|
|
8629
8624
|
const e = await this.getCaller();
|
|
8630
8625
|
for (const D of u)
|
|
8631
|
-
this.getUserStream(e.id, D).getTracks().length === 0
|
|
8626
|
+
if (this.getUserStream(e.id, D).getTracks().length === 0)
|
|
8627
|
+
try {
|
|
8628
|
+
await this.setLocalStream(D, !0);
|
|
8629
|
+
} catch (j) {
|
|
8630
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: setLocalStream is error.", j);
|
|
8631
|
+
}
|
|
8632
8632
|
const n = [];
|
|
8633
8633
|
for (const D of u)
|
|
8634
8634
|
this.getUserStream(e.id, D).getTracks().length !== 0 && n.push(D);
|
|
8635
|
-
await this.createTrack(n), await this.replaceSenderStream(n, !
|
|
8635
|
+
await this.createTrack(n), await this.replaceSenderStream(n, !1);
|
|
8636
8636
|
const O = this.getSenderTracks(u), $ = [...e.tracks, ...O], N = await this.getCallAction($);
|
|
8637
|
-
await this.updateUsertracks(e.id, $, !0), V(this, zt).call(this, u), await V(this, Tt).call(this, N);
|
|
8637
|
+
await this.updateUsertracks(e.id, $, !0), V(this, zt).call(this, u), await V(this, Tt).call(this, N), await this.replaceSenderStream(n, !0);
|
|
8638
8638
|
{
|
|
8639
8639
|
await this.emitNotifyUpdateUsers();
|
|
8640
8640
|
const D = await this.getCaller();
|
|
@@ -8647,7 +8647,7 @@ class RoomCalls extends RoomPeer {
|
|
|
8647
8647
|
_(`publish is error: ${e.message || e}`);
|
|
8648
8648
|
}
|
|
8649
8649
|
};
|
|
8650
|
-
this.taskQueue.addTask(k, ["createWs", "createSession", "ice", "createTrack", "subscribe"], { describe: "replaceSenderStream" });
|
|
8650
|
+
this.taskQueue.addTask(k, ["createWs", "createSession", "ice", "joinRoom", "createTrack", "subscribe"], { describe: "replaceSenderStream" });
|
|
8651
8651
|
}));
|
|
8652
8652
|
/**
|
|
8653
8653
|
* 停止发布流
|