@3dsource/angular-unreal-module 0.0.117 → 0.0.118
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.
|
@@ -4,9 +4,8 @@ import { SourceButtonComponent, SourceLoadingComponent } from '@3dsource/source-
|
|
|
4
4
|
import { merge, map, scan, timestamp, startWith, pairwise, concatMap, of, animationFrameScheduler, interval, Observable, skip, switchMap, concat, delay, debounceTime, timer, take, timeout, mergeMap, EMPTY, Subject, share, takeUntil as takeUntil$1, from, fromEvent, throwError, defer, retry, tap as tap$1, NEVER, throttleTime, asyncScheduler, filter as filter$1, withLatestFrom as withLatestFrom$1, Subscription, bufferTime, combineLatestWith, distinctUntilChanged as distinctUntilChanged$1 } from 'rxjs';
|
|
5
5
|
import { createAction, props, createReducer, on, createFeature, createSelector, Store, provideState } from '@ngrx/store';
|
|
6
6
|
import { Actions, createEffect, ofType, provideEffects } from '@ngrx/effects';
|
|
7
|
-
import { map as map$1, distinctUntilChanged, takeWhile, filter, tap, takeUntil, catchError,
|
|
7
|
+
import { map as map$1, distinctUntilChanged, takeWhile, filter, tap, withLatestFrom, takeUntil, catchError, exhaustMap, switchMap as switchMap$1, timeout as timeout$1, debounceTime as debounceTime$1, take as take$1, startWith as startWith$1 } from 'rxjs/operators';
|
|
8
8
|
import { Logger, calculateMedian, clampf, lerp, getCanvasCached, getSnapshot, fitIntoRectangle, whereNot, Truthy, tapLog, Falsy, generateUuid, COLOR_CODES, where, KeyboardNumericCode, InvertedKeyMap, Semaphore, HEXtoRGB, RGBtoHSV, inverseLerp, HSVtoRGB, RGBtoHEX, fpIsASameAsB } from '@3dsource/utils';
|
|
9
|
-
import { concatLatestFrom } from '@ngrx/operators';
|
|
10
9
|
import { DialogRef, DIALOG_DATA, Dialog } from '@angular/cdk/dialog';
|
|
11
10
|
import { HttpClient } from '@angular/common/http';
|
|
12
11
|
import { ScrollStrategyOptions } from '@angular/cdk/overlay';
|
|
@@ -1249,7 +1248,7 @@ class UnrealEffects {
|
|
|
1249
1248
|
}), map(() => destroyRemoteConnections({ reason: DisconnectReason.Destroy })));
|
|
1250
1249
|
});
|
|
1251
1250
|
this.changeStreamResolution$ = createEffect(() => {
|
|
1252
|
-
return this.actions$.pipe(ofType(changeStreamResolutionAction), filter((size) => !!(size?.width && size?.height)),
|
|
1251
|
+
return this.actions$.pipe(ofType(changeStreamResolutionAction), filter((size) => !!(size?.width && size?.height)), withLatestFrom(this.store.select(unrealFeature.selectStreamResolution)), filter(([newSizes, savedSizes]) => !(newSizes.width === savedSizes.width &&
|
|
1253
1252
|
newSizes.height === savedSizes.height)), map(([sizes]) => changeStreamResolutionSuccessAction({
|
|
1254
1253
|
width: sizes.width,
|
|
1255
1254
|
height: sizes.height,
|
|
@@ -1340,10 +1339,10 @@ class UnrealEffects {
|
|
|
1340
1339
|
* a visible flicker (video flashing to black).
|
|
1341
1340
|
*/
|
|
1342
1341
|
this.forceViewportNotReady$ = createEffect(() => {
|
|
1343
|
-
return this.actions$.pipe(ofType(destroyRemoteConnections),
|
|
1342
|
+
return this.actions$.pipe(ofType(destroyRemoteConnections), withLatestFrom(this.store.select(unrealFeature.selectViewportReady)), filter(([, viewportReady]) => viewportReady), map(() => setViewportNotReady()));
|
|
1344
1343
|
});
|
|
1345
1344
|
this.resetCirrusOnDestroy$ = createEffect(() => {
|
|
1346
|
-
return this.actions$.pipe(ofType(destroyRemoteConnections),
|
|
1345
|
+
return this.actions$.pipe(ofType(destroyRemoteConnections), withLatestFrom(this.store.select(unrealFeature.selectCirrusConnected)), filter(([, cirrusConnected]) => cirrusConnected), map(() => setCirrusDisconnected()));
|
|
1347
1346
|
});
|
|
1348
1347
|
this.destroyRemoteConnections$ = createEffect(() => {
|
|
1349
1348
|
return this.actions$.pipe(ofType(destroyRemoteConnections), tap(({ reason }) => {
|
|
@@ -1355,7 +1354,7 @@ class UnrealEffects {
|
|
|
1355
1354
|
}), filter(({ reason }) => reason === DisconnectReason.DropConnection), map(() => dropConnection()));
|
|
1356
1355
|
});
|
|
1357
1356
|
this.destroyConnectionAndRestart$ = createEffect(() => {
|
|
1358
|
-
return this.actions$.pipe(ofType(setCirrusDisconnected),
|
|
1357
|
+
return this.actions$.pipe(ofType(setCirrusDisconnected), withLatestFrom(this.store.select(unrealFeature.selectDisconnectReason)), filter(([, reason]) => reason === DisconnectReason.DataChannelTimeout), map(() => initSignalling()));
|
|
1359
1358
|
});
|
|
1360
1359
|
this.showUnrealError$ = createEffect(() => {
|
|
1361
1360
|
return this.actions$.pipe(ofType(showUnrealErrorMessage), map(({ code }) => getRtcErrorMessage(code)), distinctUntilChanged(), filter(Truthy), switchMap((content) => this.dialog.open(UnrealErrorModalComponent, {
|
|
@@ -1364,7 +1363,7 @@ class UnrealEffects {
|
|
|
1364
1363
|
}).closed), map(() => showUnrealErrorMessage({ code: null })));
|
|
1365
1364
|
});
|
|
1366
1365
|
this.unrealReceiverReady$ = createEffect(() => {
|
|
1367
|
-
return this.actions$.pipe(ofType(dataChannelConnected),
|
|
1366
|
+
return this.actions$.pipe(ofType(dataChannelConnected), withLatestFrom(this.store.select(unrealFeature.selectIsReconnecting)), filter(([, isReconnecting]) => !isReconnecting), map(() => dataChannelReady()));
|
|
1368
1367
|
});
|
|
1369
1368
|
this.initAppByDataChannelReady$ = createEffect(() => {
|
|
1370
1369
|
return this.actions$.pipe(ofType(dataChannelReady), tap(() => {
|