@signalwire/js 4.0.0-dev-20260915014810 → 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.
package/dist/browser.mjs CHANGED
@@ -14336,22 +14336,31 @@ var SelfParticipant = class extends Participant {
14336
14336
  this.deviceController.selectAudioInputDevice(device);
14337
14337
  if (options.savePreference) PreferencesContainer.instance.preferredAudioInput = device;
14338
14338
  }
14339
- /** Updates the audio input track constraints for the active call. */
14339
+ /**
14340
+ * Updates the audio input track constraints for the active call.
14341
+ * @returns whether the constraints reached the media the call is sending.
14342
+ */
14340
14343
  async setAudioInputDeviceConstraints(constraints) {
14341
- await this.vertoManager.updateMediaConstraints({ audio: constraints });
14344
+ return this.vertoManager.updateMediaConstraints({ audio: constraints });
14342
14345
  }
14343
- /** Updates both audio and video input track constraints for the active call. */
14346
+ /**
14347
+ * Updates both audio and video input track constraints for the active call.
14348
+ * @returns whether both kinds took the constraints.
14349
+ */
14344
14350
  async setInputDevicesConstraints(constraints) {
14345
- await this.vertoManager.updateMediaConstraints(constraints);
14351
+ return this.vertoManager.updateMediaConstraints(constraints);
14346
14352
  }
14347
14353
  /** Selects the video input device for future calls. Optionally saves as a preference. */
14348
14354
  selectVideoInputDevice(device, options = {}) {
14349
14355
  this.deviceController.selectVideoInputDevice(device);
14350
14356
  if (options.savePreference) PreferencesContainer.instance.preferredVideoInput = device;
14351
14357
  }
14352
- /** Updates the video input track constraints for the active call. */
14358
+ /**
14359
+ * Updates the video input track constraints for the active call.
14360
+ * @returns whether the constraints reached the media the call is sending.
14361
+ */
14353
14362
  async setVideoInputDeviceConstraints(constraints) {
14354
- await this.vertoManager.updateMediaConstraints({ video: constraints });
14363
+ return this.vertoManager.updateMediaConstraints({ video: constraints });
14355
14364
  }
14356
14365
  /** Selects the audio output device. Optionally saves as a preference. */
14357
14366
  selectAudioOutputDevice(device, options = {}) {
@@ -17393,16 +17402,25 @@ var WebRTCVertoManager = class extends VertoManager {
17393
17402
  this.onError?.(new VertoPongError(error));
17394
17403
  }
17395
17404
  }
17405
+ /**
17406
+ * @returns whether the constraints reached the media the call is sending.
17407
+ * `false` is an outcome, not a failure: the leg may have no live sender of
17408
+ * the kind, or carry media the SDK did not capture and may not replace.
17409
+ * A failure behind it still reaches the call's `errors$`, so a caller that
17410
+ * ignores this value learns of it there.
17411
+ */
17396
17412
  async updateMediaConstraints(options = {}) {
17397
17413
  const { audio, video } = options;
17414
+ let applied = true;
17398
17415
  try {
17399
- if (audio) await this.mainPeerConnection.updateSendersConstraints("audio", audio);
17400
- if (video) await this.mainPeerConnection.updateSendersConstraints("video", video);
17416
+ if (audio) applied = await this.mainPeerConnection.updateSendersConstraints("audio", audio) && applied;
17417
+ if (video) applied = await this.mainPeerConnection.updateSendersConstraints("video", video) && applied;
17401
17418
  } catch (error) {
17402
17419
  logger$16.warn("[WebRTCManager] Error updating media constraints:", error);
17403
17420
  this.reportLegError(toError(error), this.mainPeerConnection);
17404
17421
  throw error;
17405
17422
  }
17423
+ return applied;
17406
17424
  }
17407
17425
  get selfId() {
17408
17426
  return this._selfId$.value;
@@ -19961,17 +19979,28 @@ var WebRTCCall = class extends Destroyable {
19961
19979
  * (notably iOS Safari) fall back to re-acquiring the track with the new
19962
19980
  * constraint set and plumbing the replacement through the local audio
19963
19981
  * pipeline if one is active.
19982
+ *
19983
+ * @returns whether the constraint reached the microphone. `false` is an
19984
+ * outcome rather than an error — a leg sending media the SDK did not capture
19985
+ * is left alone — so a UI that reflects the toggle must read it. Any failure
19986
+ * behind a `false` is also reported on {@link errors$}.
19964
19987
  */
19965
19988
  async setEchoCancellation(enabled) {
19966
- await this.vertoManager.updateMediaConstraints({ audio: { echoCancellation: enabled } });
19989
+ return this.vertoManager.updateMediaConstraints({ audio: { echoCancellation: enabled } });
19967
19990
  }
19968
- /** Toggle browser noise suppression on the local mic at runtime. */
19991
+ /**
19992
+ * Toggle browser noise suppression on the local mic at runtime.
19993
+ * @returns whether the constraint reached the microphone.
19994
+ */
19969
19995
  async setNoiseSuppression(enabled) {
19970
- await this.vertoManager.updateMediaConstraints({ audio: { noiseSuppression: enabled } });
19996
+ return this.vertoManager.updateMediaConstraints({ audio: { noiseSuppression: enabled } });
19971
19997
  }
19972
- /** Toggle browser automatic gain control on the local mic at runtime. */
19998
+ /**
19999
+ * Toggle browser automatic gain control on the local mic at runtime.
20000
+ * @returns whether the constraint reached the microphone.
20001
+ */
19973
20002
  async setAutoGainControl(enabled) {
19974
- await this.vertoManager.updateMediaConstraints({ audio: { autoGainControl: enabled } });
20003
+ return this.vertoManager.updateMediaConstraints({ audio: { autoGainControl: enabled } });
19975
20004
  }
19976
20005
  /**
19977
20006
  * Observable of the aggregate remote audio level, 0..1 RMS. The server
@@ -23093,7 +23122,7 @@ var SignalWire = class extends Destroyable {
23093
23122
  logger$1.warn("[SignalWire] Failed to initialize VisibilityController:", error);
23094
23123
  }
23095
23124
  try {
23096
- this._diagnosticsCollector = new DiagnosticsCollector({ sdkVersion: "4.0.0-dev-20260915014810" });
23125
+ this._diagnosticsCollector = new DiagnosticsCollector({ sdkVersion: "4.0.0-dev-20260915135732" });
23097
23126
  } catch (error) {
23098
23127
  logger$1.warn("[SignalWire] Failed to initialize DiagnosticsCollector:", error);
23099
23128
  }
@@ -23648,7 +23677,7 @@ var StaticCredentialProvider = class {
23648
23677
  /**
23649
23678
  * Library version from package.json, injected at build time.
23650
23679
  */
23651
- const version = "4.0.0-dev-20260915014810";
23680
+ const version = "4.0.0-dev-20260915135732";
23652
23681
  /**
23653
23682
  * Flag indicating the library has been loaded and is ready to use.
23654
23683
  * For UMD builds: `window.SignalWire.ready`
@@ -23670,7 +23699,7 @@ const ready = true;
23670
23699
  */
23671
23700
  const emitReadyEvent = () => {
23672
23701
  if (typeof window !== "undefined") {
23673
- const event = new CustomEvent("signalwire:js:ready", { detail: { version: "4.0.0-dev-20260915014810" } });
23702
+ const event = new CustomEvent("signalwire:js:ready", { detail: { version: "4.0.0-dev-20260915135732" } });
23674
23703
  window.dispatchEvent(event);
23675
23704
  }
23676
23705
  };