@stream-io/video-client 1.9.1 → 1.9.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 +14 -0
- package/dist/index.browser.es.js +37 -18
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +37 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +37 -18
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/Call.ts +2 -2
- package/src/devices/InputMediaDeviceManager.ts +12 -4
- package/src/devices/__tests__/CameraManager.test.ts +2 -2
- package/src/devices/__tests__/InputMediaDeviceManager.test.ts +1 -1
- package/src/devices/devices.ts +32 -12
- package/src/events/__tests__/call.test.ts +30 -0
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.9.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.9.2...@stream-io/video-client-1.9.3) (2024-10-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* make device selection by device id exact ([#1538](https://github.com/GetStream/stream-video-js/issues/1538)) ([6274cac](https://github.com/GetStream/stream-video-js/commit/6274cac2ecf155aa6ce0c6d764229e0e9cd39a6a))
|
|
11
|
+
|
|
12
|
+
## [1.9.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.9.1...@stream-io/video-client-1.9.2) (2024-10-21)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **client:** invoke call.reject only when reject param specified ([#1530](https://github.com/GetStream/stream-video-js/issues/1530)) ([eac4e4e](https://github.com/GetStream/stream-video-js/commit/eac4e4ebd2575f5269f65db7173107d5cafab9bf))
|
|
18
|
+
|
|
5
19
|
## [1.9.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.9.0...@stream-io/video-client-1.9.1) (2024-10-18)
|
|
6
20
|
|
|
7
21
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -2938,7 +2938,7 @@ const retryable = async (rpc, signal) => {
|
|
|
2938
2938
|
return result;
|
|
2939
2939
|
};
|
|
2940
2940
|
|
|
2941
|
-
const version = "1.9.
|
|
2941
|
+
const version = "1.9.3";
|
|
2942
2942
|
const [major, minor, patch] = version.split('.');
|
|
2943
2943
|
let sdkInfo = {
|
|
2944
2944
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -7847,14 +7847,19 @@ const getAudioStream = async (trackConstraints) => {
|
|
|
7847
7847
|
throwOnNotAllowed: true,
|
|
7848
7848
|
forcePrompt: true,
|
|
7849
7849
|
});
|
|
7850
|
-
return getStream(constraints);
|
|
7850
|
+
return await getStream(constraints);
|
|
7851
7851
|
}
|
|
7852
|
-
catch (
|
|
7852
|
+
catch (error) {
|
|
7853
|
+
if (error instanceof OverconstrainedError && trackConstraints?.deviceId) {
|
|
7854
|
+
const { deviceId, ...relaxedContraints } = trackConstraints;
|
|
7855
|
+
getLogger(['devices'])('warn', 'Failed to get audio stream, will try again with relaxed contraints', { error, constraints, relaxedContraints });
|
|
7856
|
+
return getAudioStream(relaxedContraints);
|
|
7857
|
+
}
|
|
7853
7858
|
getLogger(['devices'])('error', 'Failed to get audio stream', {
|
|
7854
|
-
error
|
|
7855
|
-
constraints
|
|
7859
|
+
error,
|
|
7860
|
+
constraints,
|
|
7856
7861
|
});
|
|
7857
|
-
throw
|
|
7862
|
+
throw error;
|
|
7858
7863
|
}
|
|
7859
7864
|
};
|
|
7860
7865
|
/**
|
|
@@ -7877,14 +7882,19 @@ const getVideoStream = async (trackConstraints) => {
|
|
|
7877
7882
|
throwOnNotAllowed: true,
|
|
7878
7883
|
forcePrompt: true,
|
|
7879
7884
|
});
|
|
7880
|
-
return getStream(constraints);
|
|
7885
|
+
return await getStream(constraints);
|
|
7881
7886
|
}
|
|
7882
|
-
catch (
|
|
7887
|
+
catch (error) {
|
|
7888
|
+
if (error instanceof OverconstrainedError && trackConstraints?.deviceId) {
|
|
7889
|
+
const { deviceId, ...relaxedContraints } = trackConstraints;
|
|
7890
|
+
getLogger(['devices'])('warn', 'Failed to get video stream, will try again with relaxed contraints', { error, constraints, relaxedContraints });
|
|
7891
|
+
return getVideoStream(relaxedContraints);
|
|
7892
|
+
}
|
|
7883
7893
|
getLogger(['devices'])('error', 'Failed to get video stream', {
|
|
7884
|
-
error
|
|
7885
|
-
constraints
|
|
7894
|
+
error,
|
|
7895
|
+
constraints,
|
|
7886
7896
|
});
|
|
7887
|
-
throw
|
|
7897
|
+
throw error;
|
|
7888
7898
|
}
|
|
7889
7899
|
};
|
|
7890
7900
|
/**
|
|
@@ -8102,11 +8112,18 @@ class InputMediaDeviceManager {
|
|
|
8102
8112
|
if (isReactNative()) {
|
|
8103
8113
|
throw new Error('This method is not supported in React Native. Please visit https://getstream.io/video/docs/reactnative/core/camera-and-microphone/#speaker-management for reference.');
|
|
8104
8114
|
}
|
|
8105
|
-
|
|
8115
|
+
const prevDeviceId = this.state.selectedDevice;
|
|
8116
|
+
if (deviceId === prevDeviceId) {
|
|
8106
8117
|
return;
|
|
8107
8118
|
}
|
|
8108
|
-
|
|
8109
|
-
|
|
8119
|
+
try {
|
|
8120
|
+
this.state.setDevice(deviceId);
|
|
8121
|
+
await this.applySettingsToStream();
|
|
8122
|
+
}
|
|
8123
|
+
catch (error) {
|
|
8124
|
+
this.state.setDevice(prevDeviceId);
|
|
8125
|
+
throw error;
|
|
8126
|
+
}
|
|
8110
8127
|
}
|
|
8111
8128
|
async applySettingsToStream() {
|
|
8112
8129
|
await withCancellation(this.statusChangeConcurrencyTag, async () => {
|
|
@@ -8181,7 +8198,9 @@ class InputMediaDeviceManager {
|
|
|
8181
8198
|
const defaultConstraints = this.state.defaultConstraints;
|
|
8182
8199
|
const constraints = {
|
|
8183
8200
|
...defaultConstraints,
|
|
8184
|
-
deviceId: this.state.selectedDevice
|
|
8201
|
+
deviceId: this.state.selectedDevice
|
|
8202
|
+
? { exact: this.state.selectedDevice }
|
|
8203
|
+
: undefined,
|
|
8185
8204
|
};
|
|
8186
8205
|
/**
|
|
8187
8206
|
* Chains two media streams together.
|
|
@@ -9408,7 +9427,7 @@ class Call {
|
|
|
9408
9427
|
};
|
|
9409
9428
|
await waitUntilCallJoined();
|
|
9410
9429
|
}
|
|
9411
|
-
if (this.ringing) {
|
|
9430
|
+
if (reject && this.ringing) {
|
|
9412
9431
|
// I'm the one who started the call, so I should cancel it.
|
|
9413
9432
|
const hasOtherParticipants = this.state.remoteParticipants.length > 0;
|
|
9414
9433
|
if (this.isCreatedByMe &&
|
|
@@ -9418,7 +9437,7 @@ class Call {
|
|
|
9418
9437
|
// before they accepted it.
|
|
9419
9438
|
await this.reject();
|
|
9420
9439
|
}
|
|
9421
|
-
else if (
|
|
9440
|
+
else if (callingState === CallingState.RINGING) {
|
|
9422
9441
|
// Signals other users that I have rejected the incoming call.
|
|
9423
9442
|
await this.reject();
|
|
9424
9443
|
}
|
|
@@ -12450,7 +12469,7 @@ class StreamClient {
|
|
|
12450
12469
|
});
|
|
12451
12470
|
};
|
|
12452
12471
|
this.getUserAgent = () => {
|
|
12453
|
-
const version = "1.9.
|
|
12472
|
+
const version = "1.9.3";
|
|
12454
12473
|
return (this.userAgent ||
|
|
12455
12474
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
12456
12475
|
};
|