@stream-io/video-client 1.16.6 → 1.16.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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.16.7](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.16.6...@stream-io/video-client-1.16.7) (2025-02-12)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * relax device constraints on NotFoundError DOMException ([#1680](https://github.com/GetStream/stream-video-js/issues/1680)) ([c682908](https://github.com/GetStream/stream-video-js/commit/c682908408395f6863fd1549958cf4203bcc7f32))
11
+
5
12
  ## [1.16.6](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.16.5...@stream-io/video-client-1.16.6) (2025-02-11)
6
13
 
7
14
 
@@ -7464,7 +7464,7 @@ const aggregate = (stats) => {
7464
7464
  return report;
7465
7465
  };
7466
7466
 
7467
- const version = "1.16.6";
7467
+ const version = "1.16.7";
7468
7468
  const [major, minor, patch] = version.split('.');
7469
7469
  let sdkInfo = {
7470
7470
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -8556,13 +8556,23 @@ const getStream = async (constraints) => {
8556
8556
  }
8557
8557
  return stream;
8558
8558
  };
8559
- function isOverconstrainedError(error) {
8560
- return (error &&
8561
- typeof error === 'object' &&
8562
- (('name' in error && error.name === 'OverconstrainedError') ||
8563
- ('message' in error &&
8564
- typeof error.message === 'string' &&
8565
- error.message.startsWith('OverconstrainedError'))));
8559
+ function isNotFoundOrOverconstrainedError(error) {
8560
+ if (!error || typeof error !== 'object') {
8561
+ return false;
8562
+ }
8563
+ if ('name' in error && typeof error.name === 'string') {
8564
+ const name = error.name;
8565
+ if (['OverconstrainedError', 'NotFoundError'].includes(name)) {
8566
+ return true;
8567
+ }
8568
+ }
8569
+ if ('message' in error && typeof error.message === 'string') {
8570
+ const message = error.message;
8571
+ if (message.startsWith('OverconstrainedError')) {
8572
+ return true;
8573
+ }
8574
+ }
8575
+ return false;
8566
8576
  }
8567
8577
  /**
8568
8578
  * Returns an audio media stream that fulfills the given constraints.
@@ -8587,7 +8597,7 @@ const getAudioStream = async (trackConstraints) => {
8587
8597
  return await getStream(constraints);
8588
8598
  }
8589
8599
  catch (error) {
8590
- if (isOverconstrainedError(error) && trackConstraints?.deviceId) {
8600
+ if (isNotFoundOrOverconstrainedError(error) && trackConstraints?.deviceId) {
8591
8601
  const { deviceId, ...relaxedConstraints } = trackConstraints;
8592
8602
  getLogger(['devices'])('warn', 'Failed to get audio stream, will try again with relaxed constraints', { error, constraints, relaxedConstraints });
8593
8603
  return getAudioStream(relaxedConstraints);
@@ -8622,7 +8632,7 @@ const getVideoStream = async (trackConstraints) => {
8622
8632
  return await getStream(constraints);
8623
8633
  }
8624
8634
  catch (error) {
8625
- if (isOverconstrainedError(error) && trackConstraints?.deviceId) {
8635
+ if (isNotFoundOrOverconstrainedError(error) && trackConstraints?.deviceId) {
8626
8636
  const { deviceId, ...relaxedConstraints } = trackConstraints;
8627
8637
  getLogger(['devices'])('warn', 'Failed to get video stream, will try again with relaxed constraints', { error, constraints, relaxedConstraints });
8628
8638
  return getVideoStream(relaxedConstraints);
@@ -13067,7 +13077,7 @@ class StreamClient {
13067
13077
  return await this.wsConnection.connect(this.defaultWSTimeout);
13068
13078
  };
13069
13079
  this.getUserAgent = () => {
13070
- const version = "1.16.6";
13080
+ const version = "1.16.7";
13071
13081
  return (this.userAgent ||
13072
13082
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
13073
13083
  };