@stream-io/video-client 1.10.2 → 1.10.4

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 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.10.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.10.3...@stream-io/video-client-1.10.4) (2024-11-07)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * max simulcast layers preference ([#1560](https://github.com/GetStream/stream-video-js/issues/1560)) ([2b0bf28](https://github.com/GetStream/stream-video-js/commit/2b0bf2824dce41c2709e361e0521cf85e1b2fd16))
11
+
12
+ ## [1.10.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.10.2...@stream-io/video-client-1.10.3) (2024-11-05)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * camera flip did not work in react-native ([#1554](https://github.com/GetStream/stream-video-js/issues/1554)) ([423890c](https://github.com/GetStream/stream-video-js/commit/423890cb2d1925366d8a63c29f93c4c92c8104ad)), closes [#1521](https://github.com/GetStream/stream-video-js/issues/1521)
18
+
5
19
  ## [1.10.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.10.1...@stream-io/video-client-1.10.2) (2024-11-01)
6
20
 
7
21
 
@@ -3108,7 +3108,7 @@ const retryable = async (rpc, signal) => {
3108
3108
  return result;
3109
3109
  };
3110
3110
 
3111
- const version = "1.10.2";
3111
+ const version = "1.10.4";
3112
3112
  const [major, minor, patch] = version.split('.');
3113
3113
  let sdkInfo = {
3114
3114
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -3443,8 +3443,8 @@ function getIceCandidate(candidate) {
3443
3443
  const bitrateLookupTable = {
3444
3444
  h264: {
3445
3445
  2160: 5000000,
3446
- 1440: 3500000,
3447
- 1080: 2750000,
3446
+ 1440: 3000000,
3447
+ 1080: 2000000,
3448
3448
  720: 1250000,
3449
3449
  540: 750000,
3450
3450
  360: 400000,
@@ -3536,12 +3536,12 @@ const findOptimalVideoLayers = (videoTrack, targetResolution = defaultTargetReso
3536
3536
  const optimalVideoLayers = [];
3537
3537
  const settings = videoTrack.getSettings();
3538
3538
  const { width = 0, height = 0 } = settings;
3539
- const { scalabilityMode, bitrateDownscaleFactor = 2 } = publishOptions || {};
3539
+ const { scalabilityMode, bitrateDownscaleFactor = 2, maxSimulcastLayers = 3, } = publishOptions || {};
3540
3540
  const maxBitrate = getComputedMaxBitrate(targetResolution, width, height, codecInUse, publishOptions);
3541
3541
  let downscaleFactor = 1;
3542
3542
  let bitrateFactor = 1;
3543
3543
  const svcCodec = isSvcCodec(codecInUse);
3544
- for (const rid of ['f', 'h', 'q']) {
3544
+ for (const rid of ['f', 'h', 'q'].slice(0, Math.min(3, maxSimulcastLayers))) {
3545
3545
  const layer = {
3546
3546
  active: true,
3547
3547
  rid,
@@ -5559,7 +5559,8 @@ class Publisher {
5559
5559
  ? // for SVC, we only have one layer (q) and often rid is omitted
5560
5560
  enabledLayers[0]
5561
5561
  : // for non-SVC, we need to find the layer by rid (simulcast)
5562
- enabledLayers.find((l) => l.name === encoder.rid);
5562
+ enabledLayers.find((l) => l.name === encoder.rid) ??
5563
+ (params.encodings.length === 1 ? enabledLayers[0] : undefined);
5563
5564
  // flip 'active' flag only when necessary
5564
5565
  const shouldActivate = !!layer?.active;
5565
5566
  if (shouldActivate !== encoder.active) {
@@ -8775,13 +8776,16 @@ class CameraManager extends InputMediaDeviceManager {
8775
8776
  height: 720,
8776
8777
  };
8777
8778
  }
8779
+ isDirectionSupportedByDevice() {
8780
+ return isReactNative() || isMobile();
8781
+ }
8778
8782
  /**
8779
8783
  * Select the camera direction.
8780
8784
  *
8781
8785
  * @param direction the direction of the camera to select.
8782
8786
  */
8783
8787
  async selectDirection(direction) {
8784
- if (isMobile()) {
8788
+ if (this.isDirectionSupportedByDevice()) {
8785
8789
  this.state.setDirection(direction);
8786
8790
  // Providing both device id and direction doesn't work, so we deselect the device
8787
8791
  this.state.setDevice(undefined);
@@ -8846,7 +8850,9 @@ class CameraManager extends InputMediaDeviceManager {
8846
8850
  constraints.height = this.targetResolution.height;
8847
8851
  // We can't set both device id and facing mode
8848
8852
  // Device id has higher priority
8849
- if (!constraints.deviceId && this.state.direction && isMobile()) {
8853
+ if (!constraints.deviceId &&
8854
+ this.state.direction &&
8855
+ this.isDirectionSupportedByDevice()) {
8850
8856
  constraints.facingMode =
8851
8857
  this.state.direction === 'front' ? 'user' : 'environment';
8852
8858
  }
@@ -12696,7 +12702,7 @@ class StreamClient {
12696
12702
  });
12697
12703
  };
12698
12704
  this.getUserAgent = () => {
12699
- const version = "1.10.2";
12705
+ const version = "1.10.4";
12700
12706
  return (this.userAgent ||
12701
12707
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
12702
12708
  };