@signalwire/js 4.0.0-dev-20260914201232 → 4.0.0-dev-20260915135732

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.
@@ -14342,22 +14342,31 @@ var SelfParticipant = class extends Participant {
14342
14342
  this.deviceController.selectAudioInputDevice(device);
14343
14343
  if (options.savePreference) PreferencesContainer.instance.preferredAudioInput = device;
14344
14344
  }
14345
- /** Updates the audio input track constraints for the active call. */
14345
+ /**
14346
+ * Updates the audio input track constraints for the active call.
14347
+ * @returns whether the constraints reached the media the call is sending.
14348
+ */
14346
14349
  async setAudioInputDeviceConstraints(constraints) {
14347
- await this.vertoManager.updateMediaConstraints({ audio: constraints });
14350
+ return this.vertoManager.updateMediaConstraints({ audio: constraints });
14348
14351
  }
14349
- /** Updates both audio and video input track constraints for the active call. */
14352
+ /**
14353
+ * Updates both audio and video input track constraints for the active call.
14354
+ * @returns whether both kinds took the constraints.
14355
+ */
14350
14356
  async setInputDevicesConstraints(constraints) {
14351
- await this.vertoManager.updateMediaConstraints(constraints);
14357
+ return this.vertoManager.updateMediaConstraints(constraints);
14352
14358
  }
14353
14359
  /** Selects the video input device for future calls. Optionally saves as a preference. */
14354
14360
  selectVideoInputDevice(device, options = {}) {
14355
14361
  this.deviceController.selectVideoInputDevice(device);
14356
14362
  if (options.savePreference) PreferencesContainer.instance.preferredVideoInput = device;
14357
14363
  }
14358
- /** Updates the video input track constraints for the active call. */
14364
+ /**
14365
+ * Updates the video input track constraints for the active call.
14366
+ * @returns whether the constraints reached the media the call is sending.
14367
+ */
14359
14368
  async setVideoInputDeviceConstraints(constraints) {
14360
- await this.vertoManager.updateMediaConstraints({ video: constraints });
14369
+ return this.vertoManager.updateMediaConstraints({ video: constraints });
14361
14370
  }
14362
14371
  /** Selects the audio output device. Optionally saves as a preference. */
14363
14372
  selectAudioOutputDevice(device, options = {}) {
@@ -16175,10 +16184,7 @@ var RTCPeerConnectionController = class extends Destroyable {
16175
16184
  }
16176
16185
  stopRawAudioInputForPipeline() {
16177
16186
  const rawTracks = this.localStreamController.localAudioTracks;
16178
- for (const track of rawTracks) if (track.readyState === "live") {
16179
- track.stop();
16180
- this.localStreamController.removeTrack(track.id);
16181
- }
16187
+ for (const track of rawTracks) if (track.readyState === "live") this.localStreamController.removeTrack(track.id);
16182
16188
  this._localAudioPipeline?.setInputTrack(null);
16183
16189
  }
16184
16190
  get isNegotiating$() {
@@ -16948,7 +16954,13 @@ var RTCPeerConnectionController = class extends Destroyable {
16948
16954
  * carries.
16949
16955
  */
16950
16956
  async updateSendersConstraints(kind, constraints) {
16951
- if (kind === "audio" && constraints && this._localAudioPipeline) return this.applyPipelineSourceConstraints(constraints);
16957
+ if (kind === "audio" && this._localAudioPipeline) {
16958
+ if (!constraints) {
16959
+ this.stopTrackSender("audio");
16960
+ return false;
16961
+ }
16962
+ return this.applyPipelineSourceConstraints(constraints);
16963
+ }
16952
16964
  return await this.transceiverController?.updateSendersConstraints(kind, constraints) ?? false;
16953
16965
  }
16954
16966
  /**
@@ -17396,16 +17408,25 @@ var WebRTCVertoManager = class extends VertoManager {
17396
17408
  this.onError?.(new VertoPongError(error));
17397
17409
  }
17398
17410
  }
17411
+ /**
17412
+ * @returns whether the constraints reached the media the call is sending.
17413
+ * `false` is an outcome, not a failure: the leg may have no live sender of
17414
+ * the kind, or carry media the SDK did not capture and may not replace.
17415
+ * A failure behind it still reaches the call's `errors$`, so a caller that
17416
+ * ignores this value learns of it there.
17417
+ */
17399
17418
  async updateMediaConstraints(options = {}) {
17400
17419
  const { audio, video } = options;
17420
+ let applied = true;
17401
17421
  try {
17402
- if (audio) await this.mainPeerConnection.updateSendersConstraints("audio", audio);
17403
- if (video) await this.mainPeerConnection.updateSendersConstraints("video", video);
17422
+ if (audio) applied = await this.mainPeerConnection.updateSendersConstraints("audio", audio) && applied;
17423
+ if (video) applied = await this.mainPeerConnection.updateSendersConstraints("video", video) && applied;
17404
17424
  } catch (error) {
17405
17425
  logger$16.warn("[WebRTCManager] Error updating media constraints:", error);
17406
17426
  this.reportLegError(toError(error), this.mainPeerConnection);
17407
17427
  throw error;
17408
17428
  }
17429
+ return applied;
17409
17430
  }
17410
17431
  get selfId() {
17411
17432
  return this._selfId$.value;
@@ -19964,17 +19985,28 @@ var WebRTCCall = class extends Destroyable {
19964
19985
  * (notably iOS Safari) fall back to re-acquiring the track with the new
19965
19986
  * constraint set and plumbing the replacement through the local audio
19966
19987
  * pipeline if one is active.
19988
+ *
19989
+ * @returns whether the constraint reached the microphone. `false` is an
19990
+ * outcome rather than an error — a leg sending media the SDK did not capture
19991
+ * is left alone — so a UI that reflects the toggle must read it. Any failure
19992
+ * behind a `false` is also reported on {@link errors$}.
19967
19993
  */
19968
19994
  async setEchoCancellation(enabled) {
19969
- await this.vertoManager.updateMediaConstraints({ audio: { echoCancellation: enabled } });
19995
+ return this.vertoManager.updateMediaConstraints({ audio: { echoCancellation: enabled } });
19970
19996
  }
19971
- /** Toggle browser noise suppression on the local mic at runtime. */
19997
+ /**
19998
+ * Toggle browser noise suppression on the local mic at runtime.
19999
+ * @returns whether the constraint reached the microphone.
20000
+ */
19972
20001
  async setNoiseSuppression(enabled) {
19973
- await this.vertoManager.updateMediaConstraints({ audio: { noiseSuppression: enabled } });
20002
+ return this.vertoManager.updateMediaConstraints({ audio: { noiseSuppression: enabled } });
19974
20003
  }
19975
- /** Toggle browser automatic gain control on the local mic at runtime. */
20004
+ /**
20005
+ * Toggle browser automatic gain control on the local mic at runtime.
20006
+ * @returns whether the constraint reached the microphone.
20007
+ */
19976
20008
  async setAutoGainControl(enabled) {
19977
- await this.vertoManager.updateMediaConstraints({ audio: { autoGainControl: enabled } });
20009
+ return this.vertoManager.updateMediaConstraints({ audio: { autoGainControl: enabled } });
19978
20010
  }
19979
20011
  /**
19980
20012
  * Observable of the aggregate remote audio level, 0..1 RMS. The server
@@ -23096,7 +23128,7 @@ var SignalWire = class extends Destroyable {
23096
23128
  logger$1.warn("[SignalWire] Failed to initialize VisibilityController:", error);
23097
23129
  }
23098
23130
  try {
23099
- this._diagnosticsCollector = new DiagnosticsCollector({ sdkVersion: "4.0.0-dev-20260914201232" });
23131
+ this._diagnosticsCollector = new DiagnosticsCollector({ sdkVersion: "4.0.0-dev-20260915135732" });
23100
23132
  } catch (error) {
23101
23133
  logger$1.warn("[SignalWire] Failed to initialize DiagnosticsCollector:", error);
23102
23134
  }
@@ -23651,7 +23683,7 @@ var StaticCredentialProvider = class {
23651
23683
  /**
23652
23684
  * Library version from package.json, injected at build time.
23653
23685
  */
23654
- const version = "4.0.0-dev-20260914201232";
23686
+ const version = "4.0.0-dev-20260915135732";
23655
23687
  /**
23656
23688
  * Flag indicating the library has been loaded and is ready to use.
23657
23689
  * For UMD builds: `window.SignalWire.ready`
@@ -23673,7 +23705,7 @@ const ready = true;
23673
23705
  */
23674
23706
  const emitReadyEvent = () => {
23675
23707
  if (typeof window !== "undefined") {
23676
- const event = new CustomEvent("signalwire:js:ready", { detail: { version: "4.0.0-dev-20260914201232" } });
23708
+ const event = new CustomEvent("signalwire:js:ready", { detail: { version: "4.0.0-dev-20260915135732" } });
23677
23709
  window.dispatchEvent(event);
23678
23710
  }
23679
23711
  };