@stream-io/video-client 1.12.2 → 1.12.3
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 +7 -0
- package/dist/index.browser.es.js +23 -16
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +23 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +23 -16
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/devices/BrowserPermission.ts +7 -3
- package/src/devices/devices.ts +21 -18
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.12.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.12.2...@stream-io/video-client-1.12.3) (2024-12-13)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* multiple rare ringing issues in react-native ([#1611](https://github.com/GetStream/stream-video-js/issues/1611)) ([4e25264](https://github.com/GetStream/stream-video-js/commit/4e25264808eab469b7b7ab184fb19961d47bdff3))
|
|
11
|
+
|
|
5
12
|
## [1.12.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.12.1...@stream-io/video-client-1.12.2) (2024-12-11)
|
|
6
13
|
|
|
7
14
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -3299,7 +3299,7 @@ const retryable = async (rpc, signal) => {
|
|
|
3299
3299
|
return result;
|
|
3300
3300
|
};
|
|
3301
3301
|
|
|
3302
|
-
const version = "1.12.
|
|
3302
|
+
const version = "1.12.3";
|
|
3303
3303
|
const [major, minor, patch] = version.split('.');
|
|
3304
3304
|
let sdkInfo = {
|
|
3305
3305
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -8321,7 +8321,7 @@ class BrowserPermission {
|
|
|
8321
8321
|
(this.wasPrompted && !forcePrompt)) {
|
|
8322
8322
|
const isGranted = this.state === 'granted';
|
|
8323
8323
|
if (!isGranted && throwOnNotAllowed) {
|
|
8324
|
-
throw new
|
|
8324
|
+
throw new Error('Permission was not granted previously, and prompting again is not allowed');
|
|
8325
8325
|
}
|
|
8326
8326
|
return isGranted;
|
|
8327
8327
|
}
|
|
@@ -8333,7 +8333,10 @@ class BrowserPermission {
|
|
|
8333
8333
|
return true;
|
|
8334
8334
|
}
|
|
8335
8335
|
catch (e) {
|
|
8336
|
-
if (e
|
|
8336
|
+
if (e &&
|
|
8337
|
+
typeof e === 'object' &&
|
|
8338
|
+
'name' in e &&
|
|
8339
|
+
(e.name === 'NotAllowedError' || e.name === 'SecurityError')) {
|
|
8337
8340
|
this.logger('info', 'Browser permission was not granted', {
|
|
8338
8341
|
permission: this.permission,
|
|
8339
8342
|
});
|
|
@@ -8488,6 +8491,14 @@ const getStream = async (constraints) => {
|
|
|
8488
8491
|
}
|
|
8489
8492
|
return stream;
|
|
8490
8493
|
};
|
|
8494
|
+
function isOverconstrainedError(error) {
|
|
8495
|
+
return (error &&
|
|
8496
|
+
typeof error === 'object' &&
|
|
8497
|
+
(('name' in error && error.name === 'OverconstrainedError') ||
|
|
8498
|
+
('message' in error &&
|
|
8499
|
+
typeof error.message === 'string' &&
|
|
8500
|
+
error.message.startsWith('OverconstrainedError'))));
|
|
8501
|
+
}
|
|
8491
8502
|
/**
|
|
8492
8503
|
* Returns an audio media stream that fulfills the given constraints.
|
|
8493
8504
|
* If no constraints are provided, it uses the browser's default ones.
|
|
@@ -8511,12 +8522,10 @@ const getAudioStream = async (trackConstraints) => {
|
|
|
8511
8522
|
return await getStream(constraints);
|
|
8512
8523
|
}
|
|
8513
8524
|
catch (error) {
|
|
8514
|
-
if (error
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
getLogger(['devices'])('warn', 'Failed to get audio stream, will try again with relaxed contraints', { error, constraints, relaxedContraints });
|
|
8519
|
-
return getAudioStream(relaxedContraints);
|
|
8525
|
+
if (isOverconstrainedError(error) && trackConstraints?.deviceId) {
|
|
8526
|
+
const { deviceId, ...relaxedConstraints } = trackConstraints;
|
|
8527
|
+
getLogger(['devices'])('warn', 'Failed to get audio stream, will try again with relaxed constraints', { error, constraints, relaxedConstraints });
|
|
8528
|
+
return getAudioStream(relaxedConstraints);
|
|
8520
8529
|
}
|
|
8521
8530
|
getLogger(['devices'])('error', 'Failed to get audio stream', {
|
|
8522
8531
|
error,
|
|
@@ -8548,12 +8557,10 @@ const getVideoStream = async (trackConstraints) => {
|
|
|
8548
8557
|
return await getStream(constraints);
|
|
8549
8558
|
}
|
|
8550
8559
|
catch (error) {
|
|
8551
|
-
if (error
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
getLogger(['devices'])('warn', 'Failed to get video stream, will try again with relaxed contraints', { error, constraints, relaxedContraints });
|
|
8556
|
-
return getVideoStream(relaxedContraints);
|
|
8560
|
+
if (isOverconstrainedError(error) && trackConstraints?.deviceId) {
|
|
8561
|
+
const { deviceId, ...relaxedConstraints } = trackConstraints;
|
|
8562
|
+
getLogger(['devices'])('warn', 'Failed to get video stream, will try again with relaxed constraints', { error, constraints, relaxedConstraints });
|
|
8563
|
+
return getVideoStream(relaxedConstraints);
|
|
8557
8564
|
}
|
|
8558
8565
|
getLogger(['devices'])('error', 'Failed to get video stream', {
|
|
8559
8566
|
error,
|
|
@@ -12804,7 +12811,7 @@ class StreamClient {
|
|
|
12804
12811
|
return await this.wsConnection.connect(this.defaultWSTimeout);
|
|
12805
12812
|
};
|
|
12806
12813
|
this.getUserAgent = () => {
|
|
12807
|
-
const version = "1.12.
|
|
12814
|
+
const version = "1.12.3";
|
|
12808
12815
|
return (this.userAgent ||
|
|
12809
12816
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
12810
12817
|
};
|