@stream-io/video-client 0.3.23 → 0.3.24

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.cjs.js CHANGED
@@ -7537,10 +7537,9 @@ const retryable = (rpc, logger) => __awaiter(void 0, void 0, void 0, function* (
7537
7537
  const getCurrentValue = (observable$) => {
7538
7538
  let value;
7539
7539
  let err = undefined;
7540
- observable$
7541
- .pipe(operators.take(1))
7540
+ rxjs.combineLatest([observable$])
7542
7541
  .subscribe({
7543
- next: (v) => {
7542
+ next: ([v]) => {
7544
7543
  value = v;
7545
7544
  },
7546
7545
  error: (e) => {
@@ -7748,7 +7747,7 @@ const descending = (comparator) => {
7748
7747
  * Creates a new comparator which conditionally applies the given comparator.
7749
7748
  *
7750
7749
  * @example
7751
- * const shouldSortByValue = () => return false; // to turn it off
7750
+ * const shouldSortByValue = (a, b) => a % 2 === 0; // return false to turn it off
7752
7751
  * const byValue = (a, b) => a < b ? - 1 : a > b ? 1 : 0;
7753
7752
  * const comparator = conditional(shouldSortByValue)(byValue);
7754
7753
  *
@@ -8338,12 +8337,14 @@ class CallState {
8338
8337
  }
8339
8338
  };
8340
8339
  this.logger = getLogger(['CallState']);
8341
- this.participants$ = this.participantsSubject.pipe(operators.map((ps) => ps.sort(this.sortParticipantsBy)));
8342
- this.localParticipant$ = this.participants$.pipe(operators.map((participants) => participants.find(isStreamVideoLocalParticipant)));
8343
- this.remoteParticipants$ = this.participants$.pipe(operators.map((participants) => participants.filter((p) => !p.isLocalParticipant)));
8344
- this.pinnedParticipants$ = this.participants$.pipe(operators.map((participants) => participants.filter((p) => !!p.pin)));
8345
- this.dominantSpeaker$ = this.participants$.pipe(operators.map((participants) => participants.find((p) => p.isDominantSpeaker)));
8346
- this.hasOngoingScreenShare$ = this.participants$.pipe(operators.map((participants) => participants.some((p) => p.publishedTracks.includes(TrackType.SCREEN_SHARE))), operators.distinctUntilChanged());
8340
+ this.participants$ = this.participantsSubject.asObservable().pipe(
8341
+ // TODO: replace with Array.toSorted once available
8342
+ operators.map((ps) => [...ps].sort(this.sortParticipantsBy)), operators.shareReplay({ bufferSize: 1, refCount: true }));
8343
+ this.localParticipant$ = this.participants$.pipe(operators.map((participants) => participants.find(isStreamVideoLocalParticipant)), operators.shareReplay({ bufferSize: 1, refCount: true }));
8344
+ this.remoteParticipants$ = this.participants$.pipe(operators.map((participants) => participants.filter((p) => !p.isLocalParticipant)), operators.shareReplay({ bufferSize: 1, refCount: true }));
8345
+ this.pinnedParticipants$ = this.participants$.pipe(operators.map((participants) => participants.filter((p) => !!p.pin)), operators.shareReplay({ bufferSize: 1, refCount: true }));
8346
+ this.dominantSpeaker$ = this.participants$.pipe(operators.map((participants) => participants.find((p) => p.isDominantSpeaker)), operators.shareReplay({ bufferSize: 1, refCount: true }));
8347
+ this.hasOngoingScreenShare$ = this.participants$.pipe(operators.map((participants) => participants.some((p) => p.publishedTracks.includes(TrackType.SCREEN_SHARE))), operators.distinctUntilChanged(), operators.shareReplay({ bufferSize: 1, refCount: true }));
8347
8348
  this.startedAt$ = this.startedAtSubject.asObservable();
8348
8349
  this.participantCount$ = this.participantCountSubject.asObservable();
8349
8350
  this.anonymousParticipantCount$ =
@@ -9521,7 +9522,7 @@ class DynascaleManager {
9521
9522
  }
9522
9523
  this.call.updateSubscriptionsPartial(trackType, { [sessionId]: { dimension } }, debounceType);
9523
9524
  };
9524
- const participant$ = this.call.state.participants$.pipe(rxjs.map((participants) => participants.find((participant) => participant.sessionId === sessionId)), rxjs.takeWhile((participant) => !!participant), rxjs.distinctUntilChanged(), rxjs.shareReplay(1));
9525
+ const participant$ = this.call.state.participants$.pipe(rxjs.map((participants) => participants.find((participant) => participant.sessionId === sessionId)), rxjs.takeWhile((participant) => !!participant), rxjs.distinctUntilChanged(), rxjs.shareReplay({ bufferSize: 1, refCount: true }));
9525
9526
  /**
9526
9527
  * Since the video elements are now being removed from the DOM (React SDK) upon
9527
9528
  * visibility change, this subscription is not in use an stays here only for the
@@ -9640,7 +9641,7 @@ class DynascaleManager {
9640
9641
  const participant = this.call.state.findParticipantBySessionId(sessionId);
9641
9642
  if (!participant || participant.isLocalParticipant)
9642
9643
  return;
9643
- const participant$ = this.call.state.participants$.pipe(rxjs.map((participants) => participants.find((p) => p.sessionId === sessionId)), rxjs.takeWhile((p) => !!p), rxjs.distinctUntilChanged());
9644
+ const participant$ = this.call.state.participants$.pipe(rxjs.map((participants) => participants.find((p) => p.sessionId === sessionId)), rxjs.takeWhile((p) => !!p), rxjs.distinctUntilChanged(), rxjs.shareReplay({ bufferSize: 1, refCount: true }));
9644
9645
  const updateMediaStreamSubscription = participant$
9645
9646
  .pipe(rxjs.distinctUntilKeyChanged('audioStream'))
9646
9647
  .subscribe((p) => {
@@ -13186,7 +13187,7 @@ class WSConnectionFallback {
13186
13187
  }
13187
13188
  }
13188
13189
 
13189
- const version = '0.3.23';
13190
+ const version = '0.3.24';
13190
13191
 
13191
13192
  const logger = getLogger(['location']);
13192
13193
  const HINT_URL = `https://hint.stream-io-video.com/`;