@3dsource/angular-unreal-module 0.0.61 → 0.0.62-dev.0

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.
@@ -3,7 +3,7 @@ import { InjectionToken, inject, Injectable, signal, ChangeDetectionStrategy, Co
3
3
  import { filter, withLatestFrom, distinctUntilChanged, switchMap, first, catchError, timeout, tap, map as map$1, takeUntil, exhaustMap, debounceTime, takeWhile, delay, skip as skip$1 } from 'rxjs/operators';
4
4
  import { createAction, props, Store, provideState, createReducer, on, createFeature, createSelector } from '@ngrx/store';
5
5
  import { Actions, ofType, provideEffects, createEffect } from '@ngrx/effects';
6
- import { skip, share, merge, Subject, interval, of, map, from, take, fromEvent, timer, throwError, defer, Observable, switchMap as switchMap$1, retry, timeout as timeout$1, tap as tap$1, startWith, combineLatestWith, takeUntil as takeUntil$1, auditTime, debounceTime as debounceTime$1, EMPTY, mergeMap, scan, concatMap, animationFrameScheduler, BehaviorSubject, distinctUntilChanged as distinctUntilChanged$1, concat } from 'rxjs';
6
+ import { skip, share, merge, Subject, interval, of, map, from, take, fromEvent, timer, throwError, defer, Observable, switchMap as switchMap$1, retry, timeout as timeout$1, tap as tap$1, startWith, combineLatestWith, takeUntil as takeUntil$1, auditTime, EMPTY, debounceTime as debounceTime$1, mergeMap, scan, concatMap, animationFrameScheduler, BehaviorSubject, distinctUntilChanged as distinctUntilChanged$1, concat } from 'rxjs';
7
7
  import { Falsy, Truthy, Logger, calculateMedian, clampf, Signal, tapLog, generateUuid, COLOR_CODES, where, KeyboardNumericCode, InvertedKeyMap, Semaphore, lerp, getCanvasCached, getSnapshot, whereNot, HEXtoRGB, RGBtoHSV, inverseLerp, HSVtoRGB, RGBtoHEX, fpIsASameAsB, fitIntoRectangle } from '@3dsource/utils';
8
8
  import { HttpClient } from '@angular/common/http';
9
9
  import { toSignal, takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
@@ -160,6 +160,7 @@ const resetConfig = createAction(scoped `reset config`);
160
160
  const resetAfkAction = createAction(scoped `reset afk action`);
161
161
  const resetWarnTimeout = createAction(scoped `reset config warn timeout`);
162
162
  const abortEstablishingConnection = createAction(scoped `abortEstablishingConnection`);
163
+ const setUnrealPlaywrightConfig = createAction(scoped `set unreal playwright config`);
163
164
 
164
165
  const SpecialKeyCodes = {
165
166
  BackSpace: 8,
@@ -274,7 +275,7 @@ const POLLING_TIME = 4000;
274
275
  const WS_OPEN_STATE = 1;
275
276
  const DEFAULT_AFK_TIMEOUT_PERIOD = 15;
276
277
  const DEFAULT_AFK_TIMEOUT = 120;
277
- const DATA_CHANNEL_CONNECTION_TIMEOUT = 8000; // 8000 ms;
278
+ const DATA_CHANNEL_CONNECTION_TIMEOUT = 8000; //ms;
278
279
  const SIGNALLING_PERCENT_VALUE = 56;
279
280
  const SCREEN_LOCKER_CONTAINER_ID = '3dsource_start_screen';
280
281
 
@@ -297,6 +298,7 @@ class AFKService extends SubService {
297
298
  this.countdown = 0; // The inactivity warning overlay has a countdown to show time until disconnect.
298
299
  this.selectWarnTimeout = this.store.selectSignal(selectWarnTimeout);
299
300
  this.isViewportReady = this.store.selectSignal(unrealFeature.selectViewportReady);
301
+ debugger;
300
302
  this.initAfk();
301
303
  }
302
304
  initAfk() {
@@ -2961,22 +2963,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImpor
2961
2963
  type: Injectable
2962
2964
  }], ctorParameters: () => [] });
2963
2965
 
2964
- function provideAngularUnrealModule() {
2966
+ class AfkPlaywrightService extends AFKService {
2967
+ initAfk() {
2968
+ return;
2969
+ }
2970
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AfkPlaywrightService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
2971
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AfkPlaywrightService }); }
2972
+ }
2973
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AfkPlaywrightService, decorators: [{
2974
+ type: Injectable
2975
+ }] });
2976
+
2977
+ class SignallingPlaywrightService extends SignallingService {
2978
+ constructor() {
2979
+ super();
2980
+ }
2981
+ connectToSignaling(_) {
2982
+ this.store.dispatch(setUnrealPlaywrightConfig());
2983
+ this.store.dispatch(setDataChannelConnected({
2984
+ message: 'Playwright set data channel connected',
2985
+ }));
2986
+ return EMPTY;
2987
+ }
2988
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: SignallingPlaywrightService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2989
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: SignallingPlaywrightService }); }
2990
+ }
2991
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: SignallingPlaywrightService, decorators: [{
2992
+ type: Injectable
2993
+ }], ctorParameters: () => [] });
2994
+
2995
+ function provideAngularUnrealModule(config) {
2965
2996
  return [
2966
2997
  provideState(unrealFeature),
2967
2998
  provideEffects([UnrealEffects]),
2968
- AFKService,
2969
2999
  AggregatorService,
2970
3000
  CommandTelemetryService,
2971
3001
  ConsoleExtensionsService,
2972
3002
  FreezeFrameService,
2973
3003
  InputService,
2974
- SignallingService,
2975
3004
  StreamStatusTelemetryService,
2976
3005
  UnrealCommunicatorService,
2977
3006
  VideoService,
2978
3007
  WebRtcPlayerService,
2979
3008
  RegionsPingService,
3009
+ {
3010
+ provide: AFKService,
3011
+ useClass: config?.playwright ? AfkPlaywrightService : AFKService,
3012
+ },
3013
+ {
3014
+ provide: SignallingService,
3015
+ useClass: config?.playwright
3016
+ ? SignallingPlaywrightService
3017
+ : SignallingService,
3018
+ },
2980
3019
  ];
2981
3020
  }
2982
3021
 
@@ -3268,6 +3307,16 @@ const unrealReducer = createReducer(initialState, on(changeLowBandwidth, (state,
3268
3307
  ...state,
3269
3308
  establishingConnection: false,
3270
3309
  };
3310
+ }), on(setUnrealPlaywrightConfig, (state) => {
3311
+ return {
3312
+ ...state,
3313
+ wasInitialized: true,
3314
+ isFirstSuccessLoad: true,
3315
+ cirrusConnected: true,
3316
+ viewportReady: true,
3317
+ dataChannelConnected: true,
3318
+ isVideoPlaying: true,
3319
+ };
3271
3320
  }), on(destroyUnrealScene, () => {
3272
3321
  return initialState;
3273
3322
  }));
@@ -3486,7 +3535,7 @@ class UnrealEffects {
3486
3535
  return this.actions$.pipe(ofType(setOrchestrationContext), tapLog('setOrchestrationContext'), map(() => initSignalling()));
3487
3536
  });
3488
3537
  this.listenUnrealCallbackByInitSignalling$ = createEffect(() => {
3489
- return this.actions$.pipe(ofType(initSignalling), switchMap$1(() => fromSignal(UnrealInternalSignalEvents.UnrealCallback).pipe(map(({ json }) => json?.commandCallback
3538
+ return this.actions$.pipe(ofType(initSignalling), filter(() => !this.unrealInitialConfig?.playwright), switchMap$1(() => fromSignal(UnrealInternalSignalEvents.UnrealCallback).pipe(map(({ json }) => json?.commandCallback
3490
3539
  ?.correlationId), filter(Truthy), map((id) => commandCompleted({ id })))));
3491
3540
  });
3492
3541
  this.connectToSignaling$ = createEffect(() => {
@@ -5059,5 +5108,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImpor
5059
5108
  * Generated bundle index. Do not edit.
5060
5109
  */
5061
5110
 
5062
- export { AFKService, AggregatorService, AnswerHandler, CONSOLE_COMMAND_DISABLE_MESSAGES, CONSOLE_COMMAND_ENABLE_MESSAGES, CONSOLE_COMMAND_PIXEL_QUALITY, ClickableOverlayComponent, CommandTelemetryService, ConfigHandler, ConsoleExtensionsService, DATA_CHANNEL_CONNECTION_TIMEOUT, DEBOUNCE_TO_MANY_RESIZE_CALLS, DEFAULT_AFK_TIMEOUT, DEFAULT_AFK_TIMEOUT_PERIOD, DataFlowMonitor, DevModeService, DisconnectReason, EControlSchemeType, EMessageType, EToClientMessageType, FULL_HD_HEIGHT, FULL_HD_WIDTH, FilterSettingsComponent, FreezeFrameComponent, FreezeFrameService, IceCandidateHandler, ImageLoadingSrcComponent, InputOptions, InputService, InstanceReadyHandler, InstanceReservedHandler, IntroSrcComponent, KalmanFilter1D, LatencyTimings, LowBandwidthDetectorComponent, LowBandwidthModalComponent, MINIMAL_FPS, MouseButton, MouseButtonsMask, OnCloseHandler, OnErrorHandler, OnMessageHandler, OnOpenHandler, OrchestrationMessageTypes, POLLING_TIME, PingHandler, PlayerCountHandler, RegionsPingService, ResetTelemetry, SAME_SIZE_THRESHOLD, SCREEN_LOCKER_CONTAINER_ID, SIGNALLING_PERCENT_VALUE, SSInfoHandler, STREAMING_VIDEO_ID, SafePipe, SignallingService, SpecialKeyCodes, StatGraphComponent, StreamStatusTelemetryService, SubService, TelemetryStart, TelemetryStop, UNREAL_CONFIG, UnrealCommunicatorService, UnrealEffects, UnrealInternalSignalEvents, UnrealSceneComponent, UnrealStatusMessage, VideoRecorder, VideoService, VideoStatsComponent, WSCloseCode_CIRRUS_ABNORMAL_CLOSURE, WSCloseCode_CIRRUS_MAX_PLAYERS_ERROR, WSCloseCode_CIRRUS_PLAYER_DISCONNECTED, WSCloseCode_CIRRUS_STREAMER_KIKED_PLAYER, WSCloseCode_FORCE_CIRRUS_CLOSE, WSCloseCode_NORMAL_AFK_TIMEOUT, WSCloseCode_NORMAL_CLOSURE, WSCloseCode_NORMAL_MANUAL_DISCONNECT, WSCloseCode_UNKNOWN, WSCloseCodes, WS_OPEN_STATE, WS_TIMEOUT, WebRtcPlayerService, WebrtcErrorModalComponent, abortEstablishingConnection, alignProductsToPlaneCommand, changeLowBandwidth, changeStatusMainVideoOnScene, changeStreamResolutionAction, changeStreamResolutionSuccessAction, clampPanToProductsCommand, commandCompleted, commandStarted, decodeData, destroyRemoteConnections, destroyUnrealScene, disconnectStream, dispatchResize, dropConnection, floatToSmoothPercents, forceResizeUnrealVideo, fromResizeObserver, fromSignal, fromUnrealCallBackSignal, getActiveUrl, getApplyCameraPresetCommand, getApplyZoomCommand, getCameraBoxCommand, getCameraRecenterCommand, getCameraSettingsCommand, getChangeGizmoTypeCommand, getChangeResolutionCommand, getClickSnapCommand, getControlSensitivityCommand, getDebugModeCommand, getDragCommand, getDragSequenceCommand, getDropCommand, getEnableComposureCommand, getEnableControlsCommand, getEnableSceneStateCallbackCommand, getEnableSpinnerModeCommand, getEnableTeleportCommand, getExecuteConsoleCommand, getFitToObjectsCommand, getFreezeFrameCommand, getFreezeFrameNative, getImageFromVideoStream, getInitSequenceByObjectNameCommand, getJumpToSequenceCommand, getLoadLevelCommand, getLoadProductCommand, getLoadSceneStateCommand, getLoopBackCommand, getMoveSelectedCommand, getPauseSequenceCommand, getPlaySequenceCommand, getRequestCameraPresetCommand, getResetControlClampsCommand, getRotateSelectedCommand, getRtcErrorMessage, getSelectProductByObjectNameCommand, getSetCameraControlClampsCommand, getSetControlCameraModeCommand, getSetFpsCommand, getSetMaterialCommand, getSetPawnMovementModeCommand, getSetSettingsSequenceCommand, getStopSequenceCommand, getTakeRenderCommand, getTakeSpinnerRenderCommand, getTakeSpinnerRenderPreviewCommand, getUnLoadAllProductsCommand, getUnLoadProductByObjectNameCommand, getUnfreezeFrameNative, getUnselectAllProductsCommand, getWeatherCommand, initSignalling, initialState, isLoaderScreenVisible, keepMaxUntilReset, mapQpToQuality, observeCommandResponse, provideAngularUnrealModule, removeExileCommands, resetAfk, resetAfkAction, resetConfig, resetIntroSrc, resetWarnTimeout, selectClientAndViewIds, selectCommandProgress, selectCommandsInProgress, selectFreezeFrameCombinedDataUrl, selectFreezeFrameDataUrl, selectFreezeFrameDataUrlFromVideo, selectFreezeFrameProgressMessageFromVideo, selectIsAutostart, selectIsExistMatchUrls, selectIsFreezeFrameLoading, selectIsVideoPlayingAndDataChannelConnected, selectLastCommandInProgress, selectLoaderCommands, selectShowLoader, selectShowReconnectPopup, selectSignalingParameters, selectStreamConfig, selectTotalProgress, selectWarnTimeout, sendSignal, setAwsInstance, setCirrusConnected, setCirrusDisconnected, setConfig, setDataChannelConnected, setEstablishingConnection, setFreezeFrame, setFreezeFrameFromVideo, setIntroImageSrc, setIntroVideoSrc, setLoadingImageSrc, setLoopBackCommandIsCompleted, setMaxFps, setOrchestrationContext, setOrchestrationMessage, setOrchestrationParameters, setOrchestrationProgress, setProductsLocationCommand, setSignalingName, setStatusMessage, setStatusPercentSignallingServer, setStreamClientCompanyId, setStreamViewId, setViewportNotReady, setViewportReady, showPopupWithoutAutoStart, showUnrealErrorMessage, smoothTransition, startStream, trackMixpanelEvent, unLoadAllLevelsCommand, unrealFeature, unrealReducer, updateCirrusInfo };
5111
+ export { AFKService, AfkPlaywrightService, AggregatorService, AnswerHandler, CONSOLE_COMMAND_DISABLE_MESSAGES, CONSOLE_COMMAND_ENABLE_MESSAGES, CONSOLE_COMMAND_PIXEL_QUALITY, ClickableOverlayComponent, CommandTelemetryService, ConfigHandler, ConsoleExtensionsService, DATA_CHANNEL_CONNECTION_TIMEOUT, DEBOUNCE_TO_MANY_RESIZE_CALLS, DEFAULT_AFK_TIMEOUT, DEFAULT_AFK_TIMEOUT_PERIOD, DataFlowMonitor, DevModeService, DisconnectReason, EControlSchemeType, EMessageType, EToClientMessageType, FULL_HD_HEIGHT, FULL_HD_WIDTH, FilterSettingsComponent, FreezeFrameComponent, FreezeFrameService, IceCandidateHandler, ImageLoadingSrcComponent, InputOptions, InputService, InstanceReadyHandler, InstanceReservedHandler, IntroSrcComponent, KalmanFilter1D, LatencyTimings, LowBandwidthDetectorComponent, LowBandwidthModalComponent, MINIMAL_FPS, MouseButton, MouseButtonsMask, OnCloseHandler, OnErrorHandler, OnMessageHandler, OnOpenHandler, OrchestrationMessageTypes, POLLING_TIME, PingHandler, PlayerCountHandler, RegionsPingService, ResetTelemetry, SAME_SIZE_THRESHOLD, SCREEN_LOCKER_CONTAINER_ID, SIGNALLING_PERCENT_VALUE, SSInfoHandler, STREAMING_VIDEO_ID, SafePipe, SignallingPlaywrightService, SignallingService, SpecialKeyCodes, StatGraphComponent, StreamStatusTelemetryService, SubService, TelemetryStart, TelemetryStop, UNREAL_CONFIG, UnrealCommunicatorService, UnrealEffects, UnrealInternalSignalEvents, UnrealSceneComponent, UnrealStatusMessage, VideoRecorder, VideoService, VideoStatsComponent, WSCloseCode_CIRRUS_ABNORMAL_CLOSURE, WSCloseCode_CIRRUS_MAX_PLAYERS_ERROR, WSCloseCode_CIRRUS_PLAYER_DISCONNECTED, WSCloseCode_CIRRUS_STREAMER_KIKED_PLAYER, WSCloseCode_FORCE_CIRRUS_CLOSE, WSCloseCode_NORMAL_AFK_TIMEOUT, WSCloseCode_NORMAL_CLOSURE, WSCloseCode_NORMAL_MANUAL_DISCONNECT, WSCloseCode_UNKNOWN, WSCloseCodes, WS_OPEN_STATE, WS_TIMEOUT, WebRtcPlayerService, WebrtcErrorModalComponent, abortEstablishingConnection, alignProductsToPlaneCommand, changeLowBandwidth, changeStatusMainVideoOnScene, changeStreamResolutionAction, changeStreamResolutionSuccessAction, clampPanToProductsCommand, commandCompleted, commandStarted, decodeData, destroyRemoteConnections, destroyUnrealScene, disconnectStream, dispatchResize, dropConnection, floatToSmoothPercents, forceResizeUnrealVideo, fromResizeObserver, fromSignal, fromUnrealCallBackSignal, getActiveUrl, getApplyCameraPresetCommand, getApplyZoomCommand, getCameraBoxCommand, getCameraRecenterCommand, getCameraSettingsCommand, getChangeGizmoTypeCommand, getChangeResolutionCommand, getClickSnapCommand, getControlSensitivityCommand, getDebugModeCommand, getDragCommand, getDragSequenceCommand, getDropCommand, getEnableComposureCommand, getEnableControlsCommand, getEnableSceneStateCallbackCommand, getEnableSpinnerModeCommand, getEnableTeleportCommand, getExecuteConsoleCommand, getFitToObjectsCommand, getFreezeFrameCommand, getFreezeFrameNative, getImageFromVideoStream, getInitSequenceByObjectNameCommand, getJumpToSequenceCommand, getLoadLevelCommand, getLoadProductCommand, getLoadSceneStateCommand, getLoopBackCommand, getMoveSelectedCommand, getPauseSequenceCommand, getPlaySequenceCommand, getRequestCameraPresetCommand, getResetControlClampsCommand, getRotateSelectedCommand, getRtcErrorMessage, getSelectProductByObjectNameCommand, getSetCameraControlClampsCommand, getSetControlCameraModeCommand, getSetFpsCommand, getSetMaterialCommand, getSetPawnMovementModeCommand, getSetSettingsSequenceCommand, getStopSequenceCommand, getTakeRenderCommand, getTakeSpinnerRenderCommand, getTakeSpinnerRenderPreviewCommand, getUnLoadAllProductsCommand, getUnLoadProductByObjectNameCommand, getUnfreezeFrameNative, getUnselectAllProductsCommand, getWeatherCommand, initSignalling, initialState, isLoaderScreenVisible, keepMaxUntilReset, mapQpToQuality, observeCommandResponse, provideAngularUnrealModule, removeExileCommands, resetAfk, resetAfkAction, resetConfig, resetIntroSrc, resetWarnTimeout, selectClientAndViewIds, selectCommandProgress, selectCommandsInProgress, selectFreezeFrameCombinedDataUrl, selectFreezeFrameDataUrl, selectFreezeFrameDataUrlFromVideo, selectFreezeFrameProgressMessageFromVideo, selectIsAutostart, selectIsExistMatchUrls, selectIsFreezeFrameLoading, selectIsVideoPlayingAndDataChannelConnected, selectLastCommandInProgress, selectLoaderCommands, selectShowLoader, selectShowReconnectPopup, selectSignalingParameters, selectStreamConfig, selectTotalProgress, selectWarnTimeout, sendSignal, setAwsInstance, setCirrusConnected, setCirrusDisconnected, setConfig, setDataChannelConnected, setEstablishingConnection, setFreezeFrame, setFreezeFrameFromVideo, setIntroImageSrc, setIntroVideoSrc, setLoadingImageSrc, setLoopBackCommandIsCompleted, setMaxFps, setOrchestrationContext, setOrchestrationMessage, setOrchestrationParameters, setOrchestrationProgress, setProductsLocationCommand, setSignalingName, setStatusMessage, setStatusPercentSignallingServer, setStreamClientCompanyId, setStreamViewId, setUnrealPlaywrightConfig, setViewportNotReady, setViewportReady, showPopupWithoutAutoStart, showUnrealErrorMessage, smoothTransition, startStream, trackMixpanelEvent, unLoadAllLevelsCommand, unrealFeature, unrealReducer, updateCirrusInfo };
5063
5112
  //# sourceMappingURL=3dsource-angular-unreal-module.mjs.map