@3dsource/angular-unreal-module 0.0.80 → 0.0.81-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.
@@ -593,6 +593,7 @@ const BITRATE_MONITOR = new DataFlowMonitor(FilterModel.yellowFlag, FilterModel.
593
593
  class VideoService extends SubService {
594
594
  constructor() {
595
595
  super();
596
+ this.container = null;
596
597
  this.latencyTestTimings = new LatencyTimings();
597
598
  this.videoTrack$ = new Subject();
598
599
  this.VideoEncoderQP = 0;
@@ -615,7 +616,7 @@ class VideoService extends SubService {
615
616
  BITRATE_MONITOR.config(data);
616
617
  });
617
618
  }
618
- setContainer(container) {
619
+ setContainer(container = null) {
619
620
  this.container = container;
620
621
  }
621
622
  setLatencyTimings(latencyTimings) {
@@ -3481,7 +3482,8 @@ const unrealReducer = createReducer(initialState, on(changeLowBandwidth, (state,
3481
3482
  },
3482
3483
  };
3483
3484
  }), on(disconnectStream, (state, errorMessage) => {
3484
- if (state.dataChannelConnected) {
3485
+ if (state.dataChannelConnected ||
3486
+ state.disconnectReason === DisconnectReason.Destroy) {
3485
3487
  return state;
3486
3488
  }
3487
3489
  return {
@@ -3689,9 +3691,10 @@ class UnrealEffects {
3689
3691
  }), map(({ reason }) => destroyRemoteConnections({ reason })));
3690
3692
  });
3691
3693
  this.destroyConnections$ = createEffect(() => {
3692
- return this.actions$.pipe(ofType(destroyUnrealScene), tap(() => this.commandsSender.destroy()), map(() => destroyRemoteConnections({
3693
- reason: DisconnectReason.Destroy,
3694
- })));
3694
+ return this.actions$.pipe(ofType(destroyUnrealScene), tap(() => {
3695
+ this.videoService.setContainer(null);
3696
+ this.commandsSender.destroy();
3697
+ }), map(() => destroyRemoteConnections({ reason: DisconnectReason.Destroy })));
3695
3698
  });
3696
3699
  this.destroyRemoteConnections$ = createEffect(() => {
3697
3700
  return this.actions$.pipe(ofType(destroyRemoteConnections), tap(({ reason }) => {