@stream-io/video-client 1.9.0 → 1.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-client",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -80,9 +80,10 @@ export const findOptimalVideoLayers = (
80
80
  const layer: OptimalVideoLayer = {
81
81
  active: true,
82
82
  rid,
83
- width,
84
- height,
85
- maxBitrate,
83
+ width: Math.round(width / downscaleFactor),
84
+ height: Math.round(height / downscaleFactor),
85
+ maxBitrate:
86
+ Math.round(maxBitrate / bitrateFactor) || defaultBitratePerRid[rid],
86
87
  maxFramerate: 30,
87
88
  };
88
89
  if (svcCodec) {
@@ -91,15 +92,12 @@ export const findOptimalVideoLayers = (
91
92
  layer.scalabilityMode = scalabilityMode || 'L3T2_KEY';
92
93
  } else {
93
94
  // for non-SVC codecs, we need to downscale proportionally (simulcast)
94
- layer.width = Math.round(width / downscaleFactor);
95
- layer.height = Math.round(height / downscaleFactor);
96
- const bitrate = Math.round(maxBitrate / bitrateFactor);
97
- layer.maxBitrate = bitrate || defaultBitratePerRid[rid];
98
95
  layer.scaleResolutionDownBy = downscaleFactor;
99
- downscaleFactor *= 2;
100
- bitrateFactor *= bitrateDownscaleFactor;
101
96
  }
102
97
 
98
+ downscaleFactor *= 2;
99
+ bitrateFactor *= bitrateDownscaleFactor;
100
+
103
101
  // Reversing the order [f, h, q] to [q, h, f] as Chrome uses encoding index
104
102
  // when deciding which layer to disable when CPU or bandwidth is constrained.
105
103
  // Encodings should be ordered in increasing spatial resolution order.