@signalwire/js 4.0.0-dev-20260311182902 → 4.0.0-dev-20260311213302

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/browser.mjs CHANGED
@@ -12051,7 +12051,13 @@ var Participant = class extends Destroyable {
12051
12051
  }
12052
12052
  /** Removes this participant from the call. */
12053
12053
  async remove() {
12054
- await this.executeMethod(this.id, "call.member.remove", {});
12054
+ const state = this._state$.value;
12055
+ const target = {
12056
+ member_id: this.id,
12057
+ call_id: state.call_id ?? "",
12058
+ node_id: state.node_id ?? ""
12059
+ };
12060
+ await this.executeMethod(target, "call.member.remove", {});
12055
12061
  }
12056
12062
  /** Ends the call for this participant. */
12057
12063
  async end() {
@@ -12419,6 +12425,9 @@ var CallEventsManager = class extends Destroyable {
12419
12425
  get participants$() {
12420
12426
  return this.cachedObservable("participants$", () => this._participants$.asObservable().pipe((0, import_cjs$14.map)((participantsRecord) => Object.values(participantsRecord))));
12421
12427
  }
12428
+ get participants() {
12429
+ return Object.values(this._participants$.value);
12430
+ }
12422
12431
  get self$() {
12423
12432
  return this.cachedObservable("self$", () => this._self$.asObservable().pipe(filterNull()));
12424
12433
  }
@@ -14623,7 +14632,6 @@ var WebRTCCall = class extends Destroyable {
14623
14632
  this.clientSession = clientSession;
14624
14633
  this.options = options;
14625
14634
  this.address = address;
14626
- this.participantsMap = /* @__PURE__ */ new Map();
14627
14635
  this._errors$ = this.createSubject();
14628
14636
  this._answered$ = this.createReplaySubject();
14629
14637
  this._holdState = false;
@@ -14696,7 +14704,7 @@ var WebRTCCall = class extends Destroyable {
14696
14704
  }
14697
14705
  /** Current snapshot of all participants in the call. */
14698
14706
  get participants() {
14699
- return Array.from(this.participantsMap.values());
14707
+ return this.callEventsManager.participants;
14700
14708
  }
14701
14709
  /** The local participant, or `null` if not yet joined. */
14702
14710
  get self() {
@@ -14746,18 +14754,22 @@ var WebRTCCall = class extends Destroyable {
14746
14754
  }
14747
14755
  }
14748
14756
  buildMethodParams(target, args) {
14749
- const reference = {
14750
- node_id: this.nodeId,
14751
- call_id: this.id
14757
+ const self = {
14758
+ node_id: this.nodeId ?? "",
14759
+ call_id: this.id,
14760
+ member_id: this.vertoManager.selfId ?? ""
14761
+ };
14762
+ if (typeof target === "object") return {
14763
+ ...args,
14764
+ self,
14765
+ targets: [target]
14752
14766
  };
14753
14767
  return {
14754
14768
  ...args,
14755
- self: {
14756
- ...reference,
14757
- member_id: this.vertoManager.selfId
14758
- },
14769
+ self,
14759
14770
  target: {
14760
- ...reference,
14771
+ node_id: this.nodeId ?? "",
14772
+ call_id: this.id,
14761
14773
  member_id: target
14762
14774
  }
14763
14775
  };
@@ -15020,7 +15032,6 @@ var WebRTCCall = class extends Destroyable {
15020
15032
  this._status$.next("destroyed");
15021
15033
  this.vertoManager.destroy();
15022
15034
  this.callEventsManager.destroy();
15023
- this.participantsMap.clear();
15024
15035
  super.destroy();
15025
15036
  }
15026
15037
  };
@@ -16378,7 +16389,8 @@ const buildOptionsFromDestination = (destination) => {
16378
16389
  const channel = new URLSearchParams(queryString).get("channel");
16379
16390
  if (channel === "video") return {
16380
16391
  audio: true,
16381
- video: true
16392
+ video: true,
16393
+ receiveVideo: true
16382
16394
  };
16383
16395
  else if (channel === "audio") return {
16384
16396
  audio: true,