@stream-io/video-client 1.30.0 → 1.30.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 +7 -0
- package/dist/index.browser.es.js +10 -7
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +10 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +10 -7
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/devices/CameraManager.ts +11 -7
- package/src/devices/__tests__/CameraManager.test.ts +19 -0
package/dist/index.es.js
CHANGED
|
@@ -5758,7 +5758,7 @@ const getSdkVersion = (sdk) => {
|
|
|
5758
5758
|
return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
|
|
5759
5759
|
};
|
|
5760
5760
|
|
|
5761
|
-
const version = "1.30.
|
|
5761
|
+
const version = "1.30.1";
|
|
5762
5762
|
const [major, minor, patch] = version.split('.');
|
|
5763
5763
|
let sdkInfo = {
|
|
5764
5764
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -10652,16 +10652,17 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
10652
10652
|
this.logger('warn', 'Setting direction is not supported on this device');
|
|
10653
10653
|
return;
|
|
10654
10654
|
}
|
|
10655
|
-
// providing both device id and direction doesn't work, so we deselect the device
|
|
10656
|
-
this.state.setDirection(direction);
|
|
10657
|
-
this.state.setDevice(undefined);
|
|
10658
10655
|
if (isReactNative()) {
|
|
10659
10656
|
const videoTrack = this.getTracks()[0];
|
|
10660
10657
|
await videoTrack?.applyConstraints({
|
|
10661
10658
|
facingMode: direction === 'front' ? 'user' : 'environment',
|
|
10662
10659
|
});
|
|
10660
|
+
this.state.setDirection(direction);
|
|
10663
10661
|
return;
|
|
10664
10662
|
}
|
|
10663
|
+
// providing both device id and direction doesn't work, so we deselect the device
|
|
10664
|
+
this.state.setDirection(direction);
|
|
10665
|
+
this.state.setDevice(undefined);
|
|
10665
10666
|
this.getTracks().forEach((track) => track.stop());
|
|
10666
10667
|
try {
|
|
10667
10668
|
await this.unmuteStream();
|
|
@@ -10726,7 +10727,7 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
10726
10727
|
return;
|
|
10727
10728
|
// Wait for any in progress camera operation
|
|
10728
10729
|
await this.statusChangeSettled();
|
|
10729
|
-
const { target_resolution, camera_facing, camera_default_on } = settings;
|
|
10730
|
+
const { target_resolution, camera_facing, camera_default_on, enabled } = settings;
|
|
10730
10731
|
// normalize target resolution to landscape format.
|
|
10731
10732
|
// on mobile devices, the device itself adjusts the resolution to portrait or landscape
|
|
10732
10733
|
// depending on the orientation of the device. using portrait resolution
|
|
@@ -10746,7 +10747,9 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
10746
10747
|
// The camera is already enabled (e.g. lobby screen). Publish the stream
|
|
10747
10748
|
await this.publishStream(mediaStream);
|
|
10748
10749
|
}
|
|
10749
|
-
else if (this.state.status === undefined &&
|
|
10750
|
+
else if (this.state.status === undefined &&
|
|
10751
|
+
camera_default_on &&
|
|
10752
|
+
enabled) {
|
|
10750
10753
|
// Start camera if backend config specifies, and there is no local setting
|
|
10751
10754
|
await this.enable();
|
|
10752
10755
|
}
|
|
@@ -14660,7 +14663,7 @@ class StreamClient {
|
|
|
14660
14663
|
this.getUserAgent = () => {
|
|
14661
14664
|
if (!this.cachedUserAgent) {
|
|
14662
14665
|
const { clientAppIdentifier = {} } = this.options;
|
|
14663
|
-
const { sdkName = 'js', sdkVersion = "1.30.
|
|
14666
|
+
const { sdkName = 'js', sdkVersion = "1.30.1", ...extras } = clientAppIdentifier;
|
|
14664
14667
|
this.cachedUserAgent = [
|
|
14665
14668
|
`stream-video-${sdkName}-v${sdkVersion}`,
|
|
14666
14669
|
...Object.entries(extras).map(([key, value]) => `${key}=${value}`),
|