quickvo-sdk-js 0.5.6 → 0.5.7

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
@@ -7697,7 +7697,6 @@ class RoomMedias extends RoomBase {
7697
7697
  * 初始化本地流
7698
7698
  */
7699
7699
  Z(this, "initLocalStream", async (u) => {
7700
- console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: initLocalStream", u);
7701
7700
  const { userId: E } = this.options;
7702
7701
  switch (u) {
7703
7702
  // 麦克风
@@ -8569,6 +8568,21 @@ class RoomCalls extends RoomPeer {
8569
8568
  };
8570
8569
  u === "audioinput" && await n("microphoneCamera_audio"), u === "videoinput" && await n("microphoneCamera_video");
8571
8570
  });
8571
+ /**
8572
+ * 设置正在使用的媒体设备
8573
+ * @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
8574
+ * @param deviceId 设备ID
8575
+ */
8576
+ Z(this, "changeScreenSharing", async (u) => {
8577
+ const E = await this.getCaller(), { tracks: _ = [], callActionMap: k } = E;
8578
+ try {
8579
+ await this.setLocalStream(u, !0), console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: 123");
8580
+ for (const e of u)
8581
+ _.find((O) => O.mediaType === e && k[e]) && await this.replaceSenderStream([e], !0);
8582
+ } catch (e) {
8583
+ console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: changeScreenSharing is error.", e);
8584
+ }
8585
+ });
8572
8586
  /**
8573
8587
  * 添加广播事件
8574
8588
  * @param notify Notify
@@ -8675,18 +8689,18 @@ class RoomCalls extends RoomPeer {
8675
8689
  const k = async () => {
8676
8690
  try {
8677
8691
  await this.replaceSenderStream(u, !1), await this.createTrack(u);
8678
- const e = await this.getCaller(), n = this.getSenderTracks(u), O = [...e.tracks, ...n];
8679
- await this.updateUsertracks(e.id, O, !0);
8680
- const $ = await this.getCallAction(O);
8681
- await Q(this, It).call(this, $), await this.replaceSenderStream(u, !0), Q(this, Kt).call(this, u);
8692
+ const e = await this.getCaller();
8682
8693
  try {
8683
8694
  await this.setLocalStream(u, !0);
8684
8695
  } catch {
8685
8696
  }
8686
- const N = [];
8697
+ const n = [];
8687
8698
  for (const D of u)
8688
- this.getUserStream(e.id, D).getTracks().length === 0 && N.push(D);
8689
- console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: inactive_mediaTypes", N), N.length !== 0 && await this.inactiveTracks(N, !1);
8699
+ this.getUserStream(e.id, D).getTracks().length === 0 && n.push(D);
8700
+ const O = this.getSenderTracks(u), $ = [...e.tracks, ...O];
8701
+ await this.updateUsertracks(e.id, $, !0);
8702
+ const N = await this.getCallAction($);
8703
+ await Q(this, It).call(this, N), await this.replaceSenderStream(u, !0), Q(this, Kt).call(this, u), n.length !== 0 && await this.inactiveTracks(n, !1);
8690
8704
  {
8691
8705
  await this.emitNotifyUpdateUsers();
8692
8706
  const D = await this.getCaller();
@@ -8958,8 +8972,8 @@ class RoomCalls extends RoomPeer {
8958
8972
  /**
8959
8973
  * 提前建连
8960
8974
  */
8961
- Z(this, "earlyConnect", () => {
8962
- this.isEarly = !0, this.createWs(), this.createSession(), this.createTrack(["microphoneCamera_audio", "microphoneCamera_video"]);
8975
+ Z(this, "earlyConnect", (u = []) => {
8976
+ this.isEarly = !0, this.createWs(), this.createSession(), u.length === 0 && (u = ["microphoneCamera_audio", "microphoneCamera_video"]), this.createTrack(u);
8963
8977
  });
8964
8978
  this.setRoomState("ready");
8965
8979
  }