@stream-io/video-client 1.10.3 → 1.10.5

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/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.3";
3112
+ const version = "1.10.5";
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: 3500000,
3448
- 1080: 2750000,
3447
+ 1440: 3000000,
3448
+ 1080: 2000000,
3449
3449
  720: 1250000,
3450
3450
  540: 750000,
3451
3451
  360: 400000,
@@ -3537,12 +3537,13 @@ 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
+ const totalLayers = svcCodec ? 3 : Math.min(3, maxSimulcastLayers);
3546
+ for (const rid of ['f', 'h', 'q'].slice(0, totalLayers)) {
3546
3547
  const layer = {
3547
3548
  active: true,
3548
3549
  rid,
@@ -5560,7 +5561,8 @@ class Publisher {
5560
5561
  ? // for SVC, we only have one layer (q) and often rid is omitted
5561
5562
  enabledLayers[0]
5562
5563
  : // for non-SVC, we need to find the layer by rid (simulcast)
5563
- enabledLayers.find((l) => l.name === encoder.rid);
5564
+ enabledLayers.find((l) => l.name === encoder.rid) ??
5565
+ (params.encodings.length === 1 ? enabledLayers[0] : undefined);
5564
5566
  // flip 'active' flag only when necessary
5565
5567
  const shouldActivate = !!layer?.active;
5566
5568
  if (shouldActivate !== encoder.active) {
@@ -12700,7 +12702,7 @@ class StreamClient {
12700
12702
  });
12701
12703
  };
12702
12704
  this.getUserAgent = () => {
12703
- const version = "1.10.3";
12705
+ const version = "1.10.5";
12704
12706
  return (this.userAgent ||
12705
12707
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
12706
12708
  };