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