@stream-io/video-client 0.3.19 → 0.3.21

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,20 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.3.21](https://github.com/GetStream/stream-video-js/compare/client0.3.20...client0.3.21) (2023-09-20)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * unmount video element when there is no video track or participant is invisible ([#1096](https://github.com/GetStream/stream-video-js/issues/1096)) ([bd01835](https://github.com/GetStream/stream-video-js/commit/bd01835f4e93c981ca2e5a7e4e09142ea4e326cf)), closes [#1094](https://github.com/GetStream/stream-video-js/issues/1094)
11
+
12
+ ### [0.3.20](https://github.com/GetStream/stream-video-js/compare/client0.3.19...client0.3.20) (2023-09-19)
13
+
14
+
15
+ ### Features
16
+
17
+ * Update with new API spec ([#1098](https://github.com/GetStream/stream-video-js/issues/1098)) ([ced372c](https://github.com/GetStream/stream-video-js/commit/ced372ca068086375024d59a977014efcadefef2))
18
+
5
19
  ### [0.3.19](https://github.com/GetStream/stream-video-js/compare/client0.3.18...client0.3.19) (2023-09-15)
6
20
 
7
21
 
package/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # @stream-io/video-client
2
2
 
3
- 🚧 **WARNING** This package is not yet stable, it is for internal use only. For more information check out our [video product page](https://getstream.io/video/). 🚧
4
-
5
3
  Low-level video client for browser and Node.js integrations.
6
4
 
7
5
  ## **Quick Links**
@@ -8351,6 +8351,8 @@ class CallState {
8351
8351
  'connection.error': undefined,
8352
8352
  'connection.ok': undefined,
8353
8353
  'health.check': undefined,
8354
+ 'call.recording_failed': undefined,
8355
+ 'call.recording_ready': undefined,
8354
8356
  custom: undefined,
8355
8357
  // events that update call state:
8356
8358
  'call.accepted': (e) => this.updateFromCallResponse(e.call),
@@ -9452,9 +9454,23 @@ class DynascaleManager {
9452
9454
  if (!boundParticipant)
9453
9455
  return;
9454
9456
  const requestTrackWithDimensions = (debounceType, dimension) => {
9457
+ if (dimension && (dimension.width === 0 || dimension.height === 0)) {
9458
+ // ignore 0x0 dimensions. this can happen when the video element
9459
+ // is not visible (e.g., has display: none).
9460
+ // we treat this as "unsubscription" as we don't want to keep
9461
+ // consuming bandwidth for a video that is not visible on the screen.
9462
+ this.logger('debug', `Ignoring 0x0 dimension`, boundParticipant);
9463
+ dimension = undefined;
9464
+ }
9455
9465
  this.call.updateSubscriptionsPartial(trackType, { [sessionId]: { dimension } }, debounceType);
9456
9466
  };
9457
9467
  const participant$ = this.call.state.participants$.pipe(map$2((participants) => participants.find((participant) => participant.sessionId === sessionId)), takeWhile((participant) => !!participant), distinctUntilChanged$1(), shareReplay(1));
9468
+ /**
9469
+ * Since the video elements are now being removed from the DOM (React SDK) upon
9470
+ * visibility change, this subscription is not in use an stays here only for the
9471
+ * plain JS integrations where integrators might choose not to remove the video
9472
+ * elements from the DOM.
9473
+ */
9458
9474
  // keep copy for resize observer handler
9459
9475
  let viewportVisibilityState;
9460
9476
  const viewportVisibilityStateSubscription = boundParticipant.isLocalParticipant
@@ -9499,6 +9515,8 @@ class DynascaleManager {
9499
9515
  lastDimensions = currentDimensions;
9500
9516
  });
9501
9517
  resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.observe(videoElement);
9518
+ // element renders and gets bound - track subscription gets
9519
+ // triggered first other ones get skipped on initial subscriptions
9502
9520
  const publishedTracksSubscription = boundParticipant.isLocalParticipant
9503
9521
  ? null
9504
9522
  : participant$
@@ -9508,14 +9526,14 @@ class DynascaleManager {
9508
9526
  .subscribe((isPublishing) => {
9509
9527
  if (isPublishing) {
9510
9528
  // the participant just started to publish a track
9511
- requestTrackWithDimensions(DebounceType.IMMEDIATE, {
9529
+ requestTrackWithDimensions(DebounceType.FAST, {
9512
9530
  width: videoElement.clientWidth,
9513
9531
  height: videoElement.clientHeight,
9514
9532
  });
9515
9533
  }
9516
9534
  else {
9517
9535
  // the participant just stopped publishing a track
9518
- requestTrackWithDimensions(DebounceType.IMMEDIATE, undefined);
9536
+ requestTrackWithDimensions(DebounceType.FAST, undefined);
9519
9537
  }
9520
9538
  });
9521
9539
  const streamSubscription = participant$
@@ -9540,7 +9558,7 @@ class DynascaleManager {
9540
9558
  // https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide
9541
9559
  videoElement.muted = true;
9542
9560
  return () => {
9543
- requestTrackWithDimensions(DebounceType.IMMEDIATE, undefined);
9561
+ requestTrackWithDimensions(DebounceType.FAST, undefined);
9544
9562
  viewportVisibilityStateSubscription === null || viewportVisibilityStateSubscription === void 0 ? void 0 : viewportVisibilityStateSubscription.unsubscribe();
9545
9563
  publishedTracksSubscription === null || publishedTracksSubscription === void 0 ? void 0 : publishedTracksSubscription.unsubscribe();
9546
9564
  streamSubscription.unsubscribe();
@@ -13106,7 +13124,7 @@ class WSConnectionFallback {
13106
13124
  }
13107
13125
  }
13108
13126
 
13109
- const version = '0.3.19';
13127
+ const version = '0.3.21';
13110
13128
 
13111
13129
  const logger = getLogger(['location']);
13112
13130
  const HINT_URL = `https://hint.stream-io-video.com/`;