@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/CHANGELOG.md +7 -0
- package/dist/index.browser.es.js +7 -11
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +7 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +7 -11
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/rtc/videoLayers.ts +7 -9
package/package.json
CHANGED
package/src/rtc/videoLayers.ts
CHANGED
|
@@ -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.
|