@stream-io/video-client 1.10.1 → 1.10.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 +12 -6
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +12 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +12 -6
- package/dist/index.es.js.map +1 -1
- package/dist/src/devices/CameraManager.d.ts +1 -0
- package/package.json +1 -1
- package/src/devices/CameraManager.ts +12 -2
- package/src/devices/InputMediaDeviceManager.ts +3 -3
- package/src/devices/__tests__/CameraManager.test.ts +7 -0
- package/src/devices/__tests__/InputMediaDeviceManager.test.ts +23 -0
package/dist/index.cjs.js
CHANGED
|
@@ -3129,7 +3129,7 @@ const retryable = async (rpc, signal) => {
|
|
|
3129
3129
|
return result;
|
|
3130
3130
|
};
|
|
3131
3131
|
|
|
3132
|
-
const version = "1.10.
|
|
3132
|
+
const version = "1.10.3";
|
|
3133
3133
|
const [major, minor, patch] = version.split('.');
|
|
3134
3134
|
let sdkInfo = {
|
|
3135
3135
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -8245,6 +8245,7 @@ class InputMediaDeviceManager {
|
|
|
8245
8245
|
* Starts stream.
|
|
8246
8246
|
*/
|
|
8247
8247
|
async enable() {
|
|
8248
|
+
this.state.prevStatus = this.state.optimisticStatus;
|
|
8248
8249
|
if (this.state.optimisticStatus === 'enabled') {
|
|
8249
8250
|
return;
|
|
8250
8251
|
}
|
|
@@ -8266,7 +8267,7 @@ class InputMediaDeviceManager {
|
|
|
8266
8267
|
* @param {boolean} [forceStop=false] when true, stops the tracks regardless of the state.disableMode
|
|
8267
8268
|
*/
|
|
8268
8269
|
async disable(forceStop = false) {
|
|
8269
|
-
this.state.prevStatus = this.state.
|
|
8270
|
+
this.state.prevStatus = this.state.optimisticStatus;
|
|
8270
8271
|
if (!forceStop && this.state.optimisticStatus === 'disabled') {
|
|
8271
8272
|
return;
|
|
8272
8273
|
}
|
|
@@ -8295,7 +8296,7 @@ class InputMediaDeviceManager {
|
|
|
8295
8296
|
*/
|
|
8296
8297
|
async resume() {
|
|
8297
8298
|
if (this.state.prevStatus === 'enabled' &&
|
|
8298
|
-
this.state.status
|
|
8299
|
+
this.state.status !== 'enabled') {
|
|
8299
8300
|
await this.enable();
|
|
8300
8301
|
}
|
|
8301
8302
|
}
|
|
@@ -8795,13 +8796,16 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
8795
8796
|
height: 720,
|
|
8796
8797
|
};
|
|
8797
8798
|
}
|
|
8799
|
+
isDirectionSupportedByDevice() {
|
|
8800
|
+
return isReactNative() || isMobile();
|
|
8801
|
+
}
|
|
8798
8802
|
/**
|
|
8799
8803
|
* Select the camera direction.
|
|
8800
8804
|
*
|
|
8801
8805
|
* @param direction the direction of the camera to select.
|
|
8802
8806
|
*/
|
|
8803
8807
|
async selectDirection(direction) {
|
|
8804
|
-
if (
|
|
8808
|
+
if (this.isDirectionSupportedByDevice()) {
|
|
8805
8809
|
this.state.setDirection(direction);
|
|
8806
8810
|
// Providing both device id and direction doesn't work, so we deselect the device
|
|
8807
8811
|
this.state.setDevice(undefined);
|
|
@@ -8866,7 +8870,9 @@ class CameraManager extends InputMediaDeviceManager {
|
|
|
8866
8870
|
constraints.height = this.targetResolution.height;
|
|
8867
8871
|
// We can't set both device id and facing mode
|
|
8868
8872
|
// Device id has higher priority
|
|
8869
|
-
if (!constraints.deviceId &&
|
|
8873
|
+
if (!constraints.deviceId &&
|
|
8874
|
+
this.state.direction &&
|
|
8875
|
+
this.isDirectionSupportedByDevice()) {
|
|
8870
8876
|
constraints.facingMode =
|
|
8871
8877
|
this.state.direction === 'front' ? 'user' : 'environment';
|
|
8872
8878
|
}
|
|
@@ -12714,7 +12720,7 @@ class StreamClient {
|
|
|
12714
12720
|
});
|
|
12715
12721
|
};
|
|
12716
12722
|
this.getUserAgent = () => {
|
|
12717
|
-
const version = "1.10.
|
|
12723
|
+
const version = "1.10.3";
|
|
12718
12724
|
return (this.userAgent ||
|
|
12719
12725
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
12720
12726
|
};
|