@stream-io/video-client 1.12.3 → 1.12.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 CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.12.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.12.3...@stream-io/video-client-1.12.4) (2024-12-17)
6
+
7
+
8
+ * improve test coverage reporting ([#1624](https://github.com/GetStream/stream-video-js/issues/1624)) ([32bb870](https://github.com/GetStream/stream-video-js/commit/32bb870187f0627c32d2b5692ce3de633d743582))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * adjust dynascale debouncing for upscaling and downscaling ([#1621](https://github.com/GetStream/stream-video-js/issues/1621)) [skip ci] ([7b3a721](https://github.com/GetStream/stream-video-js/commit/7b3a72192fab79d8af8d1c392a9f0135e2d25b16))
14
+ * prevent auto-dropping already accepted or rejected calls ([#1619](https://github.com/GetStream/stream-video-js/issues/1619)) ([113406a](https://github.com/GetStream/stream-video-js/commit/113406a9ba7fdf2e193a1933b73963e0011f28f0))
15
+
5
16
  ## [1.12.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.12.2...@stream-io/video-client-1.12.3) (2024-12-13)
6
17
 
7
18
 
@@ -3299,7 +3299,7 @@ const retryable = async (rpc, signal) => {
3299
3299
  return result;
3300
3300
  };
3301
3301
 
3302
- const version = "1.12.3";
3302
+ const version = "1.12.4";
3303
3303
  const [major, minor, patch] = version.split('.');
3304
3304
  let sdkInfo = {
3305
3305
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -7955,17 +7955,27 @@ class DynascaleManager {
7955
7955
  const resizeObserver = boundParticipant.isLocalParticipant
7956
7956
  ? null
7957
7957
  : new ResizeObserver(() => {
7958
- const currentDimensions = `${videoElement.clientWidth},${videoElement.clientHeight}`;
7958
+ const currentDimensions = {
7959
+ width: videoElement.clientWidth,
7960
+ height: videoElement.clientHeight,
7961
+ };
7959
7962
  // skip initial trigger
7960
7963
  if (!lastDimensions) {
7961
7964
  lastDimensions = currentDimensions;
7962
7965
  return;
7963
7966
  }
7964
- if (lastDimensions === currentDimensions ||
7967
+ if ((lastDimensions.width === currentDimensions.width &&
7968
+ lastDimensions.height === currentDimensions.height) ||
7965
7969
  viewportVisibilityState === VisibilityState.INVISIBLE) {
7966
7970
  return;
7967
7971
  }
7968
- requestTrackWithDimensions(DebounceType.SLOW, {
7972
+ const relativeDelta = Math.max(currentDimensions.width / lastDimensions.width, currentDimensions.height / lastDimensions.height);
7973
+ // Low quality video in an upscaled video element is very noticable.
7974
+ // We try to upscale faster, and downscale slower. We also update debounce
7975
+ // more if the size change is not significant, gurading against fast-firing
7976
+ // resize events.
7977
+ const debounceType = relativeDelta > 1.2 ? DebounceType.IMMEDIATE : DebounceType.MEDIUM;
7978
+ requestTrackWithDimensions(debounceType, {
7969
7979
  width: videoElement.clientWidth,
7970
7980
  height: videoElement.clientHeight,
7971
7981
  });
@@ -7981,7 +7991,7 @@ class DynascaleManager {
7981
7991
  .subscribe((isPublishing) => {
7982
7992
  if (isPublishing) {
7983
7993
  // the participant just started to publish a track
7984
- requestTrackWithDimensions(DebounceType.FAST, {
7994
+ requestTrackWithDimensions(DebounceType.IMMEDIATE, {
7985
7995
  width: videoElement.clientWidth,
7986
7996
  height: videoElement.clientHeight,
7987
7997
  });
@@ -11261,26 +11271,35 @@ class Call {
11261
11271
  * Applicable only for ringing calls.
11262
11272
  */
11263
11273
  this.scheduleAutoDrop = () => {
11264
- clearTimeout(this.dropTimeout);
11265
- this.leaveCallHooks.add(createSubscription(this.state.settings$, (settings) => {
11266
- if (!settings)
11267
- return;
11268
- // ignore if the call is not ringing
11274
+ this.cancelAutoDrop();
11275
+ const settings = this.state.settings;
11276
+ if (!settings)
11277
+ return;
11278
+ // ignore if the call is not ringing
11279
+ if (this.state.callingState !== CallingState.RINGING)
11280
+ return;
11281
+ const timeoutInMs = this.isCreatedByMe
11282
+ ? settings.ring.auto_cancel_timeout_ms
11283
+ : settings.ring.incoming_call_timeout_ms;
11284
+ // 0 means no auto-drop
11285
+ if (timeoutInMs <= 0)
11286
+ return;
11287
+ this.dropTimeout = setTimeout(() => {
11288
+ // the call might have stopped ringing by this point,
11289
+ // e.g. it was already accepted and joined
11269
11290
  if (this.state.callingState !== CallingState.RINGING)
11270
11291
  return;
11271
- const timeoutInMs = this.isCreatedByMe
11272
- ? settings.ring.auto_cancel_timeout_ms
11273
- : settings.ring.incoming_call_timeout_ms;
11274
- // 0 means no auto-drop
11275
- if (timeoutInMs <= 0)
11276
- return;
11277
- clearTimeout(this.dropTimeout);
11278
- this.dropTimeout = setTimeout(() => {
11279
- this.leave({ reject: true, reason: 'timeout' }).catch((err) => {
11280
- this.logger('error', 'Failed to drop call', err);
11281
- });
11282
- }, timeoutInMs);
11283
- }));
11292
+ this.leave({ reject: true, reason: 'timeout' }).catch((err) => {
11293
+ this.logger('error', 'Failed to drop call', err);
11294
+ });
11295
+ }, timeoutInMs);
11296
+ };
11297
+ /**
11298
+ * Cancels a scheduled auto-drop timeout.
11299
+ */
11300
+ this.cancelAutoDrop = () => {
11301
+ clearTimeout(this.dropTimeout);
11302
+ this.dropTimeout = undefined;
11284
11303
  };
11285
11304
  /**
11286
11305
  * Retrieves the list of recordings for the current call or call session.
@@ -11616,15 +11635,17 @@ class Call {
11616
11635
  }
11617
11636
  }));
11618
11637
  this.leaveCallHooks.add(
11619
- // watch for auto drop cancellation
11620
- createSubscription(this.state.callingState$, (callingState) => {
11638
+ // cancel auto-drop when call is
11639
+ createSubscription(this.state.session$, (session) => {
11621
11640
  if (!this.ringing)
11622
11641
  return;
11623
- if (callingState === CallingState.JOINED ||
11624
- callingState === CallingState.JOINING ||
11625
- callingState === CallingState.LEFT) {
11626
- clearTimeout(this.dropTimeout);
11627
- this.dropTimeout = undefined;
11642
+ const receiverId = this.clientStore.connectedUser?.id;
11643
+ if (!receiverId)
11644
+ return;
11645
+ const isAcceptedByMe = Boolean(session?.accepted_by[receiverId]);
11646
+ const isRejectedByMe = Boolean(session?.rejected_by[receiverId]);
11647
+ if (isAcceptedByMe || isRejectedByMe) {
11648
+ this.cancelAutoDrop();
11628
11649
  }
11629
11650
  }));
11630
11651
  this.leaveCallHooks.add(
@@ -12811,7 +12832,7 @@ class StreamClient {
12811
12832
  return await this.wsConnection.connect(this.defaultWSTimeout);
12812
12833
  };
12813
12834
  this.getUserAgent = () => {
12814
- const version = "1.12.3";
12835
+ const version = "1.12.4";
12815
12836
  return (this.userAgent ||
12816
12837
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
12817
12838
  };