quickvo-sdk-js 0.7.2 → 0.7.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 CHANGED
@@ -8777,24 +8777,29 @@ class RoomCalls extends RoomPeer {
8777
8777
  Z(this, "setLocalStream", (a, E) => new Promise(async (_, k) => {
8778
8778
  try {
8779
8779
  typeof a == "string" && (a = [a]);
8780
- const { userId: e = "" } = this.options;
8781
- for (const O of a)
8782
- this.localStreamsActionMap.set(O, E);
8780
+ for (const n of a)
8781
+ this.localStreamsActionMap.set(n, E);
8783
8782
  if (E) {
8784
8783
  if (a.includes("microphoneCamera_audio") && a.includes("microphoneCamera_video") ? await this.initLocalStream("microphoneCamera") : a.includes("microphoneCamera_audio") ? await this.initLocalStream("microphoneCamera_audio") : a.includes("microphoneCamera_video") ? await this.initLocalStream("microphoneCamera_video") : a.includes("screenSharing_audio") && a.includes("screenSharing_video") ? await this.initLocalStream("screenSharing") : a.includes("screenSharing_audio") && !a.includes("screenSharing_video") ? await this.initLocalStream("screenSharing_audio") : a.includes("screenSharing_video") && !a.includes("screenSharing_audio") && await this.initLocalStream("screenSharing_video"), a.includes("screenSharing_audio")) {
8785
- const $ = this.getUserStream(e, "screenSharing_audio").getTracks();
8786
- for (const N of $)
8787
- N.onended = () => this.stopPublish(["screenSharing_audio", "screenSharing_video"]);
8784
+ const n = this.getLocalStream("screenSharing_audio");
8785
+ if (n) {
8786
+ const O = n.getTracks();
8787
+ for (const $ of O)
8788
+ $.onended = () => this.stopPublish(["screenSharing_audio", "screenSharing_video"]);
8789
+ }
8788
8790
  }
8789
8791
  if (a.includes("screenSharing_video")) {
8790
- const $ = this.getUserStream(e, "screenSharing_video").getTracks();
8791
- for (const N of $)
8792
- N.onended = () => this.stopPublish(["screenSharing_audio", "screenSharing_video"]);
8792
+ const n = this.getLocalStream("screenSharing_video");
8793
+ if (n) {
8794
+ const O = n.getTracks();
8795
+ for (const $ of O)
8796
+ $.onended = () => this.stopPublish(["screenSharing_audio", "screenSharing_video"]);
8797
+ }
8793
8798
  }
8794
8799
  } else
8795
8800
  await this.stopLocalStreams(a);
8796
- const n = this.getLocalStreams(a);
8797
- this.cwsIns.emitNotify("onLocalStream", { code: 200, data: n, desc: "local stream is change." }), _(n);
8801
+ const e = this.getLocalStreams(a);
8802
+ this.cwsIns.emitNotify("onLocalStream", { code: 200, data: e, desc: "local stream is change." }), _(e);
8798
8803
  } catch (e) {
8799
8804
  k(e);
8800
8805
  }