@3dsource/angular-unreal-module 0.0.76 → 0.0.77-dev.1

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.
@@ -1588,10 +1588,10 @@ class WebRtcPlayerService extends SubService {
1588
1588
  }
1589
1589
  mungeSDP(offer) {
1590
1590
  let audioSDP = '';
1591
- // set max bitrate to highest bitrate Opus supports
1591
+ // set max bitrate to the highest bitrate Opus supports
1592
1592
  audioSDP += 'maxaveragebitrate=510000;';
1593
1593
  if (this.useMic) {
1594
- // set the max capture rate to 48khz (so we can send high quality audio from mic)
1594
+ // set the max capture rate to 48khz (so we can send high-quality audio from mic)
1595
1595
  audioSDP += 'sprop-maxcapturerate=48000;';
1596
1596
  }
1597
1597
  // Force mono or stereo based on whether ?forceMono was passed or not
@@ -2424,10 +2424,15 @@ class UnrealCommunicatorService {
2424
2424
  this.webRtcPlayerService = inject(WebRtcPlayerService);
2425
2425
  this.videoService = inject(VideoService);
2426
2426
  this.destroy$ = new Subject();
2427
+ this.afkService = inject(AFKService);
2428
+ this.consoleExtensionsService = inject(ConsoleExtensionsService);
2427
2429
  this.cirrusConnected = this.store.selectSignal(unrealFeature.selectCirrusConnected);
2428
2430
  this.init();
2429
2431
  }
2430
2432
  init() {
2433
+ this.consoleExtensionsService.init();
2434
+ this.afkService.init();
2435
+ this.freezeFrameService.init();
2431
2436
  console.log('DEBUG: UnrealCommunicatorService init');
2432
2437
  this.emitUIInteraction = this.commandTelemetryService.decorate(this.emitUIInteraction.bind(this));
2433
2438
  this.listenVideo();
@@ -2464,7 +2469,7 @@ class UnrealCommunicatorService {
2464
2469
  "{ ConsoleCommand: <string> }"
2465
2470
 
2466
2471
  2. A command to change the resolution to the given width and height.
2467
- "{ Resolution.Width: <value>, Resolution.Height: <value> } }"
2472
+ "{ Resolution.Width: <value>, Resolution.Height: <value> }"
2468
2473
  */
2469
2474
  emitCommand(descriptor) {
2470
2475
  this.emitDescriptor(EMessageType.Command, descriptor);
@@ -2533,7 +2538,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
2533
2538
 
2534
2539
  class InputService extends SubService {
2535
2540
  constructor() {
2536
- super(...arguments);
2541
+ super();
2537
2542
  this.commandsSender = inject(UnrealCommunicatorService);
2538
2543
  this.isDevMode = inject(DevModeService).isDevMode;
2539
2544
  this.defaultKeys = [
@@ -2566,9 +2571,9 @@ class InputService extends SubService {
2566
2571
  offsetByY: 0,
2567
2572
  offsetByX: 0,
2568
2573
  };
2574
+ this.init();
2569
2575
  }
2570
2576
  init() {
2571
- console.log('DEBUG: InputService init');
2572
2577
  const visibilityHiddenTrigger$ = fromEvent(document, 'visibilitychange').pipe(map$1(() => document.visibilityState === 'hidden'), filter(Truthy));
2573
2578
  const visibilityVisibleTrigger$ = fromEvent(document, 'visibilitychange').pipe(map$1(() => document.visibilityState === 'visible'), filter(Truthy), startWith(true));
2574
2579
  this.deactivatedVideoTrigger$ = merge(this.disconnect$, this.reInit$, visibilityHiddenTrigger$);
@@ -2578,6 +2583,9 @@ class InputService extends SubService {
2578
2583
  .pipe(filter(Truthy), startWith(true))), filter(([video]) => !!video))
2579
2584
  .subscribe(([video]) => this.setup(video));
2580
2585
  }
2586
+ fakeInit() {
2587
+ // it is for init
2588
+ }
2581
2589
  useKeyboardKeys(keys) {
2582
2590
  this.availableKeys = keys || [];
2583
2591
  }
@@ -3320,8 +3328,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
3320
3328
  type: Injectable
3321
3329
  }] });
3322
3330
 
3323
- function providePlaywrightProviders(config) {
3324
- return [
3331
+ function provideAngularUnrealModule(config) {
3332
+ return makeEnvironmentProviders([
3333
+ provideState(unrealFeature),
3334
+ provideEffects([UnrealEffects]),
3335
+ ConsoleExtensionsService,
3336
+ InputService,
3337
+ VideoService,
3338
+ WebRtcPlayerService,
3339
+ RegionsPingService,
3340
+ FileReceiverService,
3341
+ FileHandlerService,
3325
3342
  {
3326
3343
  provide: StreamStatusTelemetryService,
3327
3344
  useClass: config?.playwright
@@ -3374,21 +3391,6 @@ function providePlaywrightProviders(config) {
3374
3391
  ? FileReceiverPlaywrightService
3375
3392
  : FileReceiverService,
3376
3393
  },
3377
- ];
3378
- }
3379
-
3380
- function provideAngularUnrealModule(config) {
3381
- return makeEnvironmentProviders([
3382
- provideState(unrealFeature),
3383
- provideEffects([UnrealEffects]),
3384
- ConsoleExtensionsService,
3385
- InputService,
3386
- VideoService,
3387
- WebRtcPlayerService,
3388
- RegionsPingService,
3389
- FileReceiverService,
3390
- FileHandlerService,
3391
- providePlaywrightProviders(config),
3392
3394
  ]);
3393
3395
  }
3394
3396
 
@@ -3662,14 +3664,8 @@ class UnrealEffects {
3662
3664
  this.unrealInitialConfig = inject(UNREAL_CONFIG);
3663
3665
  this.webRtcPlayerService = inject(WebRtcPlayerService);
3664
3666
  this.commandsSender = inject(UnrealCommunicatorService);
3665
- this.freezeFrame = inject(FreezeFrameService);
3666
- this.inputService = inject(InputService);
3667
3667
  this.signallingService = inject(SignallingService);
3668
3668
  this.videoService = inject(VideoService);
3669
- this.afkService = inject(AFKService);
3670
- this.consoleExtensions = inject(ConsoleExtensionsService);
3671
- this.streamStatusTelemetryService = inject(StreamStatusTelemetryService);
3672
- this.aggregatorService = inject(AggregatorService);
3673
3669
  this.dataChannelConnectionTimeout = this.unrealInitialConfig?.dataChannelConnectionTimeout ??
3674
3670
  DATA_CHANNEL_CONNECTION_TIMEOUT;
3675
3671
  this.connectionCompleted$ = this.store
@@ -3888,20 +3884,13 @@ class UnrealEffects {
3888
3884
  this.forceViewportNotReady$ = createEffect(() => {
3889
3885
  return this.actions$.pipe(ofType(destroyRemoteConnections), map(() => setViewportNotReady()));
3890
3886
  });
3891
- // TODO will better to
3892
- this.inputService.init();
3893
- this.consoleExtensions.init();
3894
- this.afkService.init();
3895
- this.freezeFrame.init();
3896
- this.streamStatusTelemetryService.init();
3897
- this.aggregatorService.init();
3898
3887
  }
3899
3888
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UnrealEffects, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3900
3889
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UnrealEffects }); }
3901
3890
  }
3902
3891
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: UnrealEffects, decorators: [{
3903
3892
  type: Injectable
3904
- }], ctorParameters: () => [] });
3893
+ }] });
3905
3894
 
3906
3895
  const selectFreezeFrameDataUrlFromVideo = createSelector(unrealFeature.selectFreezeFrameFromVideo, unrealFeature.selectLowBandwidth, (freezeFrameFromVideo, isLow) => isLow ? null : freezeFrameFromVideo?.dataUrl || null);
3907
3896
  const selectFreezeFrameProgressMessageFromVideo = createSelector(unrealFeature.selectFreezeFrameFromVideo, unrealFeature.selectLowBandwidth, (freezeFrameFromVideo, isLow) => isLow ? null : freezeFrameFromVideo?.progress || null);
@@ -4851,6 +4840,9 @@ class UnrealSceneComponent {
4851
4840
  this.width = FULL_HD_WIDTH;
4852
4841
  this.height = FULL_HD_HEIGHT;
4853
4842
  this.store = inject(Store);
4843
+ this.streamStatusTelemetryService = inject(StreamStatusTelemetryService);
4844
+ this.aggregatorService = inject(AggregatorService);
4845
+ this.inputService = inject(InputService);
4854
4846
  this.isDevMode = inject(DevModeService).isDevMode;
4855
4847
  this.lightMode = this.store.selectSignal(unrealFeature.selectLowBandwidth);
4856
4848
  this.isFreezeFrameLoading = this.store.selectSignal(selectIsFreezeFrameLoading);
@@ -4878,6 +4870,11 @@ class UnrealSceneComponent {
4878
4870
  onMouseOut() {
4879
4871
  this.changeMouseOverScene.emit(false);
4880
4872
  }
4873
+ ngOnInit() {
4874
+ this.streamStatusTelemetryService.init();
4875
+ this.aggregatorService.init();
4876
+ this.inputService.fakeInit();
4877
+ }
4881
4878
  ngAfterViewInit() {
4882
4879
  this.videoService.setContainer(this.container.nativeElement);
4883
4880
  fromEvent(this.element.nativeElement, 'contextmenu')