@stream-io/video-client 1.9.0 → 1.9.2

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
@@ -2939,7 +2939,7 @@ const retryable = async (rpc, signal) => {
2939
2939
  return result;
2940
2940
  };
2941
2941
 
2942
- const version = "1.9.0";
2942
+ const version = "1.9.2";
2943
2943
  const [major, minor, patch] = version.split('.');
2944
2944
  let sdkInfo = {
2945
2945
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -3376,9 +3376,9 @@ const findOptimalVideoLayers = (videoTrack, targetResolution = defaultTargetReso
3376
3376
  const layer = {
3377
3377
  active: true,
3378
3378
  rid,
3379
- width,
3380
- height,
3381
- maxBitrate,
3379
+ width: Math.round(width / downscaleFactor),
3380
+ height: Math.round(height / downscaleFactor),
3381
+ maxBitrate: Math.round(maxBitrate / bitrateFactor) || defaultBitratePerRid[rid],
3382
3382
  maxFramerate: 30,
3383
3383
  };
3384
3384
  if (svcCodec) {
@@ -3388,14 +3388,10 @@ const findOptimalVideoLayers = (videoTrack, targetResolution = defaultTargetReso
3388
3388
  }
3389
3389
  else {
3390
3390
  // for non-SVC codecs, we need to downscale proportionally (simulcast)
3391
- layer.width = Math.round(width / downscaleFactor);
3392
- layer.height = Math.round(height / downscaleFactor);
3393
- const bitrate = Math.round(maxBitrate / bitrateFactor);
3394
- layer.maxBitrate = bitrate || defaultBitratePerRid[rid];
3395
3391
  layer.scaleResolutionDownBy = downscaleFactor;
3396
- downscaleFactor *= 2;
3397
- bitrateFactor *= bitrateDownscaleFactor;
3398
3392
  }
3393
+ downscaleFactor *= 2;
3394
+ bitrateFactor *= bitrateDownscaleFactor;
3399
3395
  // Reversing the order [f, h, q] to [q, h, f] as Chrome uses encoding index
3400
3396
  // when deciding which layer to disable when CPU or bandwidth is constrained.
3401
3397
  // Encodings should be ordered in increasing spatial resolution order.
@@ -9413,7 +9409,7 @@ class Call {
9413
9409
  };
9414
9410
  await waitUntilCallJoined();
9415
9411
  }
9416
- if (this.ringing) {
9412
+ if (reject && this.ringing) {
9417
9413
  // I'm the one who started the call, so I should cancel it.
9418
9414
  const hasOtherParticipants = this.state.remoteParticipants.length > 0;
9419
9415
  if (this.isCreatedByMe &&
@@ -9423,7 +9419,7 @@ class Call {
9423
9419
  // before they accepted it.
9424
9420
  await this.reject();
9425
9421
  }
9426
- else if (reject && callingState === CallingState.RINGING) {
9422
+ else if (callingState === CallingState.RINGING) {
9427
9423
  // Signals other users that I have rejected the incoming call.
9428
9424
  await this.reject();
9429
9425
  }
@@ -12453,7 +12449,7 @@ class StreamClient {
12453
12449
  });
12454
12450
  };
12455
12451
  this.getUserAgent = () => {
12456
- const version = "1.9.0";
12452
+ const version = "1.9.2";
12457
12453
  return (this.userAgent ||
12458
12454
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
12459
12455
  };