@stream-io/video-client 1.15.5 → 1.15.6

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.15.5",
3
+ "version": "1.15.6",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -257,6 +257,23 @@ describe('videoLayers', () => {
257
257
  });
258
258
  });
259
259
 
260
+ it('should use integer for maxBitrate', () => {
261
+ const track = new MediaStreamTrack();
262
+ const layers = computeVideoLayers(track, {
263
+ bitrate: 2999777,
264
+ // @ts-expect-error - incomplete data
265
+ codec: { name: 'vp8' },
266
+ videoDimension: { width: 1920, height: 1080 },
267
+ fps: 30,
268
+ });
269
+ expect(layers).toBeDefined();
270
+ for (const layer of layers!) {
271
+ expect(Number.isInteger(layer.width)).toBe(true);
272
+ expect(Number.isInteger(layer.height)).toBe(true);
273
+ expect(Number.isInteger(layer.maxBitrate)).toBe(true);
274
+ }
275
+ });
276
+
260
277
  describe('getComputedMaxBitrate', () => {
261
278
  it('should scale target bitrate down if resolution is smaller than target resolution', () => {
262
279
  const targetResolution = { width: 1920, height: 1080, bitrate: 3000000 };
@@ -109,7 +109,8 @@ export const computeVideoLayers = (
109
109
  rid,
110
110
  width: Math.round(width / downscaleFactor),
111
111
  height: Math.round(height / downscaleFactor),
112
- maxBitrate: maxBitrate / bitrateFactor || defaultBitratePerRid[rid],
112
+ maxBitrate:
113
+ Math.round(maxBitrate / bitrateFactor) || defaultBitratePerRid[rid],
113
114
  maxFramerate: fps,
114
115
  };
115
116
  if (svcCodec) {