From 6269db8978f0621a63b266ce73a43a0dfcf91200 Mon Sep 17 00:00:00 2001 From: csantosm <4a.santos@gmail.com> Date: Wed, 22 Jun 2022 14:01:50 +0200 Subject: [PATCH] openvidu-components: Avoided subscribe to recording events if disabled --- .../src/lib/components/session/session.component.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts index fd7d217b..5623e5b8 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/session/session.component.ts @@ -91,8 +91,7 @@ export class SessionComponent implements OnInit { protected panelService: PanelService, private recordingService: RecordingService, private translateService: TranslateService, - private platformService: PlatformService, - private cd: ChangeDetectorRef + private platformService: PlatformService ) { this.log = this.loggerSrv.get('SessionComponent'); } @@ -159,9 +158,10 @@ export class SessionComponent implements OnInit { this.subscribeToNicknameChanged(); this.chatService.subscribeToChat(); this.subscribeToReconnection(); - // if(RecordingEnabled){ - this.subscribeToRecordingEvents(); - // } + const recordingEnabled = this.libService.recordingButton.getValue() && this.libService.recordingActivity.getValue(); + if (recordingEnabled) { + this.subscribeToRecordingEvents(); + } this.onSessionCreated.emit(this.session); await this.connectToSession();