@stream-io/video-client 1.16.0 → 1.16.1
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 +10 -0
- package/dist/index.browser.es.js +32 -6
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +32 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +32 -6
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/devices/CameraManager.ts +25 -4
- package/src/devices/__tests__/CameraManager.test.ts +14 -4
- package/src/devices/__tests__/mocks.ts +4 -1
- package/src/store/stateStore.ts +2 -0
package/dist/index.es.js
CHANGED
|
@@ -3897,6 +3897,8 @@ class StreamVideoWriteableStateStore {
|
|
|
3897
3897
|
* @param call the call to remove
|
|
3898
3898
|
*/
|
|
3899
3899
|
this.unregisterCall = (call) => {
|
|
3900
|
+
const logger = getLogger(['client-state']);
|
|
3901
|
+
logger('trace', `Unregistering call: ${call.cid}`);
|
|
3900
3902
|
return this.setCalls((calls) => calls.filter((c) => c !== call));
|
|
3901
3903
|
};
|
|
3902
3904
|
/**
|
|
@@ -7393,7 +7395,7 @@ const aggregate = (stats) => {
|
|
|
7393
7395
|
return report;
|
|
7394
7396
|
};
|
|
7395
7397
|
|
|
7396
|
-
const version = "1.16.
|
|
7398
|
+
const version = "1.16.1";
|
|
7397
7399
|
const [major, minor, patch] = version.split('.');
|
|
7398
7400
|
let sdkInfo = {
|
|
7399
7401
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -9250,10 +9252,34 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
9250
9252
|
*/
|
|
9251
9253
|
async selectDirection(direction) {
|
|
9252
9254
|
if (this.isDirectionSupportedByDevice()) {
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9255
|
+
if (isReactNative()) {
|
|
9256
|
+
const videoTrack = this.getTracks()[0];
|
|
9257
|
+
if (!videoTrack)
|
|
9258
|
+
return;
|
|
9259
|
+
// @ts-expect-error _switchCamera() is only present in react-native-webrtc 124 and below
|
|
9260
|
+
if (typeof videoTrack._switchCamera === 'function') {
|
|
9261
|
+
// @ts-expect-error for older versions of react-native-webrtc support
|
|
9262
|
+
videoTrack._switchCamera();
|
|
9263
|
+
}
|
|
9264
|
+
else {
|
|
9265
|
+
const constraints = {
|
|
9266
|
+
facingMode: direction === 'front' ? 'user' : 'environment',
|
|
9267
|
+
};
|
|
9268
|
+
await videoTrack.applyConstraints(constraints);
|
|
9269
|
+
}
|
|
9270
|
+
this.state.setDirection(direction);
|
|
9271
|
+
this.state.setDevice(undefined);
|
|
9272
|
+
}
|
|
9273
|
+
else {
|
|
9274
|
+
// web mobile
|
|
9275
|
+
this.state.setDirection(direction);
|
|
9276
|
+
// Providing both device id and direction doesn't work, so we deselect the device
|
|
9277
|
+
this.state.setDevice(undefined);
|
|
9278
|
+
this.getTracks().forEach((track) => {
|
|
9279
|
+
track.stop();
|
|
9280
|
+
});
|
|
9281
|
+
await this.unmuteStream();
|
|
9282
|
+
}
|
|
9257
9283
|
}
|
|
9258
9284
|
else {
|
|
9259
9285
|
this.logger('warn', 'Camera direction ignored for desktop devices');
|
|
@@ -12974,7 +13000,7 @@ class StreamClient {
|
|
|
12974
13000
|
return await this.wsConnection.connect(this.defaultWSTimeout);
|
|
12975
13001
|
};
|
|
12976
13002
|
this.getUserAgent = () => {
|
|
12977
|
-
const version = "1.16.
|
|
13003
|
+
const version = "1.16.1";
|
|
12978
13004
|
return (this.userAgent ||
|
|
12979
13005
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
12980
13006
|
};
|