@3dsource/angular-unreal-module 0.0.81 → 0.0.83-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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Injectable, signal, effect, makeEnvironmentProviders, provideEnvironmentInitializer, ChangeDetectionStrategy, Component, Pipe, ElementRef, input, HostListener, Input, ViewChild, DestroyRef, computed, viewChild, untracked, output, afterNextRender } from '@angular/core';
2
+ import { InjectionToken, inject, Injectable, signal, makeEnvironmentProviders, provideEnvironmentInitializer, 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';
@@ -1194,7 +1194,6 @@ class SignallingService extends SubService {
1194
1194
  this.selectClientAndViewIds = this.store.selectSignal(selectClientAndViewIds);
1195
1195
  this.environmentId = this.store.selectSignal(unrealFeature.selectEnvironmentId);
1196
1196
  this.streamRequestContext = this.store.selectSignal(unrealFeature.selectStreamRequestContext);
1197
- this.dataChannelConnected = this.store.selectSignal(unrealFeature.selectDataChannelConnected);
1198
1197
  this.onOffer$ = new Subject();
1199
1198
  this.onConfig$ = new Subject();
1200
1199
  this.onWebRtcIce$ = new Subject();
@@ -1202,18 +1201,19 @@ class SignallingService extends SubService {
1202
1201
  this.abort$ = this.action$.pipe(ofType(abortEstablishingConnection));
1203
1202
  this.wsMsgHandlers = {};
1204
1203
  this.init();
1205
- effect(() => {
1206
- if (this.dataChannelConnected()) {
1207
- this.send({
1208
- type: 'p2pEstablished',
1209
- source: 'front',
1210
- sessionId: generateUuid(),
1211
- });
1212
- }
1213
- });
1214
1204
  }
1215
1205
  init() {
1216
1206
  this.setHandlersFromStream();
1207
+ this.store
1208
+ .select(unrealFeature.selectDataChannelConnected)
1209
+ .pipe(filter(Truthy))
1210
+ .subscribe(() => {
1211
+ this.send({
1212
+ type: 'p2pEstablished',
1213
+ source: 'front',
1214
+ sessionId: generateUuid(),
1215
+ });
1216
+ });
1217
1217
  }
1218
1218
  connectToSignaling(urlList) {
1219
1219
  Logger.log('CONNECT TO SIGNALLING');
@@ -2429,18 +2429,18 @@ class UnrealCommunicatorService {
2429
2429
  this.videoService = inject(VideoService);
2430
2430
  this.destroy$ = new Subject();
2431
2431
  this.cirrusConnected = this.store.selectSignal(unrealFeature.selectCirrusConnected);
2432
- this.dataChannelConnected = this.store.selectSignal(unrealFeature.selectDataChannelConnected);
2433
2432
  this.init();
2434
- effect(() => {
2435
- if (this.dataChannelConnected()) {
2436
- this.requestInitialSettings();
2437
- this.requestQualityControl();
2438
- }
2439
- });
2440
2433
  }
2441
2434
  init() {
2442
2435
  this.emitUIInteraction = this.commandTelemetryService.decorate(this.emitUIInteraction.bind(this));
2443
2436
  this.listenVideo();
2437
+ this.store
2438
+ .select(unrealFeature.selectDataChannelConnected)
2439
+ .pipe(filter(Truthy))
2440
+ .subscribe(() => {
2441
+ this.requestInitialSettings();
2442
+ this.requestQualityControl();
2443
+ });
2444
2444
  }
2445
2445
  destroy() {
2446
2446
  this.destroy$.next();
@@ -3394,6 +3394,7 @@ function provideAngularUnrealModule(config) {
3394
3394
  provideEnvironmentInitializer(() => {
3395
3395
  inject(UnrealCommunicatorService);
3396
3396
  inject(AggregatorService);
3397
+ inject(InputService);
3397
3398
  inject(StreamStatusTelemetryService);
3398
3399
  inject(ConsoleExtensionsService);
3399
3400
  inject(AFKService);