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

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Injectable, signal, makeEnvironmentProviders, ChangeDetectionStrategy, Component, Pipe, ElementRef, input, HostListener, Input, ViewChild, DestroyRef, computed, viewChild, effect, untracked, output } from '@angular/core';
2
+ import { InjectionToken, inject, Injectable, signal, makeEnvironmentProviders, ChangeDetectionStrategy, Component, Pipe, ElementRef, input, HostListener, Input, ViewChild, DestroyRef, computed, viewChild, effect, untracked, output, afterNextRender } from '@angular/core';
3
3
  import { filter, withLatestFrom, distinctUntilChanged, switchMap, 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';
@@ -2529,7 +2529,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
2529
2529
 
2530
2530
  class InputService extends SubService {
2531
2531
  constructor() {
2532
- super();
2532
+ super(...arguments);
2533
2533
  this.commandsSender = inject(UnrealCommunicatorService);
2534
2534
  this.isDevMode = inject(DevModeService).isDevMode;
2535
2535
  this.defaultKeys = [
@@ -2562,7 +2562,6 @@ class InputService extends SubService {
2562
2562
  offsetByY: 0,
2563
2563
  offsetByX: 0,
2564
2564
  };
2565
- this.init();
2566
2565
  }
2567
2566
  init() {
2568
2567
  const visibilityHiddenTrigger$ = fromEvent(document, 'visibilitychange').pipe(map$1(() => document.visibilityState === 'hidden'), filter(Truthy));
@@ -2574,9 +2573,6 @@ class InputService extends SubService {
2574
2573
  .pipe(filter(Truthy), startWith(true))), filter(([video]) => !!video))
2575
2574
  .subscribe(([video]) => this.setup(video));
2576
2575
  }
2577
- fakeInit() {
2578
- // it is for init
2579
- }
2580
2576
  useKeyboardKeys(keys) {
2581
2577
  this.availableKeys = keys || [];
2582
2578
  }
@@ -4856,24 +4852,26 @@ class UnrealSceneComponent {
4856
4852
  this.videoService = inject(VideoService);
4857
4853
  this.element = inject(ElementRef);
4858
4854
  this.destroyRef = inject(DestroyRef);
4859
- this._destroy = this.destroyRef.onDestroy(() => {
4855
+ this.destroyRef.onDestroy(() => {
4860
4856
  this.commandsSender.destroy();
4861
4857
  this.store.dispatch(destroyUnrealScene());
4862
4858
  });
4863
4859
  this.streamStatusTelemetryService.init();
4864
4860
  this.aggregatorService.init();
4865
- this.inputService.fakeInit();
4866
- effect(() => {
4867
- const videoElement = this.videoElement();
4868
- if (videoElement) {
4869
- this.videoService.setContainer(videoElement.nativeElement);
4870
- if (this.element?.nativeElement) {
4871
- fromEvent(this.element?.nativeElement, 'contextmenu')
4872
- .pipe(takeUntilDestroyed(this.destroyRef))
4873
- .subscribe((event) => event.preventDefault());
4861
+ this.inputService.init();
4862
+ afterNextRender({
4863
+ read: () => {
4864
+ const videoElement = this.videoElement();
4865
+ if (videoElement) {
4866
+ this.videoService.setContainer(videoElement.nativeElement);
4867
+ if (this.element?.nativeElement) {
4868
+ fromEvent(this.element?.nativeElement, 'contextmenu')
4869
+ .pipe(takeUntilDestroyed(this.destroyRef))
4870
+ .subscribe((event) => event.preventDefault());
4871
+ }
4872
+ this.listenResizeValues();
4874
4873
  }
4875
- this.listenResizeValues();
4876
- }
4874
+ },
4877
4875
  });
4878
4876
  }
4879
4877
  listenResizeValues() {