@stream-io/video-client 1.10.3 → 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,13 @@
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
+
5
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)
6
13
 
7
14
 
@@ -3108,7 +3108,7 @@ const retryable = async (rpc, signal) => {
3108
3108
  return result;
3109
3109
  };
3110
3110
 
3111
- const version = "1.10.3";
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) {
@@ -12701,7 +12702,7 @@ class StreamClient {
12701
12702
  });
12702
12703
  };
12703
12704
  this.getUserAgent = () => {
12704
- const version = "1.10.3";
12705
+ const version = "1.10.4";
12705
12706
  return (this.userAgent ||
12706
12707
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
12707
12708
  };