@stream-io/video-client 1.16.5 → 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 +14 -0
- package/dist/index.browser.es.js +27 -22
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +27 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +27 -22
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/devices/CameraManager.ts +7 -10
- package/src/devices/devices.ts +22 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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
|
+
|
|
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)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* prefer the async apply constraints for flip ([#1679](https://github.com/GetStream/stream-video-js/issues/1679)) ([8c246cc](https://github.com/GetStream/stream-video-js/commit/8c246cc4e9f1ac766366cf24b82dd99aa868017d))
|
|
18
|
+
|
|
5
19
|
## [1.16.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.16.4...@stream-io/video-client-1.16.5) (2025-02-10)
|
|
6
20
|
|
|
7
21
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -7464,7 +7464,7 @@ const aggregate = (stats) => {
|
|
|
7464
7464
|
return report;
|
|
7465
7465
|
};
|
|
7466
7466
|
|
|
7467
|
-
const version = "1.16.
|
|
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
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
|
|
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 (
|
|
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 (
|
|
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);
|
|
@@ -9323,19 +9333,14 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
9323
9333
|
if (this.isDirectionSupportedByDevice()) {
|
|
9324
9334
|
if (isReactNative()) {
|
|
9325
9335
|
const videoTrack = this.getTracks()[0];
|
|
9326
|
-
if (!videoTrack)
|
|
9336
|
+
if (!videoTrack) {
|
|
9337
|
+
this.logger('warn', 'No video track found to do direction selection');
|
|
9327
9338
|
return;
|
|
9328
|
-
// @ts-expect-error _switchCamera() is only present in react-native-webrtc 124 and below
|
|
9329
|
-
if (typeof videoTrack._switchCamera === 'function') {
|
|
9330
|
-
// @ts-expect-error for older versions of react-native-webrtc support
|
|
9331
|
-
videoTrack._switchCamera();
|
|
9332
|
-
}
|
|
9333
|
-
else {
|
|
9334
|
-
const constraints = {
|
|
9335
|
-
facingMode: direction === 'front' ? 'user' : 'environment',
|
|
9336
|
-
};
|
|
9337
|
-
await videoTrack.applyConstraints(constraints);
|
|
9338
9339
|
}
|
|
9340
|
+
const constraints = {
|
|
9341
|
+
facingMode: direction === 'front' ? 'user' : 'environment',
|
|
9342
|
+
};
|
|
9343
|
+
await videoTrack.applyConstraints(constraints);
|
|
9339
9344
|
this.state.setDirection(direction);
|
|
9340
9345
|
this.state.setDevice(undefined);
|
|
9341
9346
|
}
|
|
@@ -13072,7 +13077,7 @@ class StreamClient {
|
|
|
13072
13077
|
return await this.wsConnection.connect(this.defaultWSTimeout);
|
|
13073
13078
|
};
|
|
13074
13079
|
this.getUserAgent = () => {
|
|
13075
|
-
const version = "1.16.
|
|
13080
|
+
const version = "1.16.7";
|
|
13076
13081
|
return (this.userAgent ||
|
|
13077
13082
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
13078
13083
|
};
|