@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/CHANGELOG.md +7 -0
- package/dist/index.browser.es.js +19 -18
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +14 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +19 -18
- package/dist/index.es.js.map +1 -1
- package/dist/src/sorting/comparator.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/helpers/DynascaleManager.ts +2 -1
- package/src/helpers/__tests__/DynascaleManager.test.ts +4 -4
- package/src/sorting/comparator.ts +1 -1
- package/src/store/CallState.ts +10 -3
- package/src/store/__tests__/CallState.test.ts +2 -1
- package/src/store/rxUtils.ts +3 -5
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 = () =>
|
|
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.
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
this.
|
|
8345
|
-
this.
|
|
8346
|
-
this.
|
|
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.
|
|
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/`;
|