@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 +7 -0
- package/dist/index.browser.es.js +8 -7
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +8 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +8 -7
- package/dist/index.es.js.map +1 -1
- package/dist/src/types.d.ts +4 -0
- package/package.json +1 -1
- package/src/rtc/Publisher.ts +2 -1
- package/src/rtc/__tests__/Publisher.test.ts +39 -0
- package/src/rtc/bitrateLookup.ts +2 -2
- package/src/rtc/videoLayers.ts +6 -2
- package/src/types.ts +4 -0
package/dist/index.es.js
CHANGED
|
@@ -3109,7 +3109,7 @@ const retryable = async (rpc, signal) => {
|
|
|
3109
3109
|
return result;
|
|
3110
3110
|
};
|
|
3111
3111
|
|
|
3112
|
-
const version = "1.10.
|
|
3112
|
+
const version = "1.10.4";
|
|
3113
3113
|
const [major, minor, patch] = version.split('.');
|
|
3114
3114
|
let sdkInfo = {
|
|
3115
3115
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -3444,8 +3444,8 @@ function getIceCandidate(candidate) {
|
|
|
3444
3444
|
const bitrateLookupTable = {
|
|
3445
3445
|
h264: {
|
|
3446
3446
|
2160: 5000000,
|
|
3447
|
-
1440:
|
|
3448
|
-
1080:
|
|
3447
|
+
1440: 3000000,
|
|
3448
|
+
1080: 2000000,
|
|
3449
3449
|
720: 1250000,
|
|
3450
3450
|
540: 750000,
|
|
3451
3451
|
360: 400000,
|
|
@@ -3537,12 +3537,12 @@ const findOptimalVideoLayers = (videoTrack, targetResolution = defaultTargetReso
|
|
|
3537
3537
|
const optimalVideoLayers = [];
|
|
3538
3538
|
const settings = videoTrack.getSettings();
|
|
3539
3539
|
const { width = 0, height = 0 } = settings;
|
|
3540
|
-
const { scalabilityMode, bitrateDownscaleFactor = 2 } = publishOptions || {};
|
|
3540
|
+
const { scalabilityMode, bitrateDownscaleFactor = 2, maxSimulcastLayers = 3, } = publishOptions || {};
|
|
3541
3541
|
const maxBitrate = getComputedMaxBitrate(targetResolution, width, height, codecInUse, publishOptions);
|
|
3542
3542
|
let downscaleFactor = 1;
|
|
3543
3543
|
let bitrateFactor = 1;
|
|
3544
3544
|
const svcCodec = isSvcCodec(codecInUse);
|
|
3545
|
-
for (const rid of ['f', 'h', 'q']) {
|
|
3545
|
+
for (const rid of ['f', 'h', 'q'].slice(0, Math.min(3, maxSimulcastLayers))) {
|
|
3546
3546
|
const layer = {
|
|
3547
3547
|
active: true,
|
|
3548
3548
|
rid,
|
|
@@ -5560,7 +5560,8 @@ class Publisher {
|
|
|
5560
5560
|
? // for SVC, we only have one layer (q) and often rid is omitted
|
|
5561
5561
|
enabledLayers[0]
|
|
5562
5562
|
: // for non-SVC, we need to find the layer by rid (simulcast)
|
|
5563
|
-
enabledLayers.find((l) => l.name === encoder.rid)
|
|
5563
|
+
enabledLayers.find((l) => l.name === encoder.rid) ??
|
|
5564
|
+
(params.encodings.length === 1 ? enabledLayers[0] : undefined);
|
|
5564
5565
|
// flip 'active' flag only when necessary
|
|
5565
5566
|
const shouldActivate = !!layer?.active;
|
|
5566
5567
|
if (shouldActivate !== encoder.active) {
|
|
@@ -12700,7 +12701,7 @@ class StreamClient {
|
|
|
12700
12701
|
});
|
|
12701
12702
|
};
|
|
12702
12703
|
this.getUserAgent = () => {
|
|
12703
|
-
const version = "1.10.
|
|
12704
|
+
const version = "1.10.4";
|
|
12704
12705
|
return (this.userAgent ||
|
|
12705
12706
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
12706
12707
|
};
|