From 1be876678c8195902dca8570b55da46cedd94d24 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Fri, 4 Jul 2025 15:55:22 +0200 Subject: [PATCH] ov-components: add subscription for virtual background effects management --- .../src/lib/components/session/session.component.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/session/session.component.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/session/session.component.ts index 794be160..c4139a3d 100644 --- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/session/session.component.ts +++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/session/session.component.ts @@ -204,6 +204,7 @@ export class SessionComponent implements OnInit, OnDestroy { // this.subscribeToParticipantNameChanged(); this.subscribeToDataMessage(); this.subscribeToReconnection(); + this.subscribeToVirtualBackground(); if (this.libService.isRecordingEnabled()) { // this.subscribeToRecordingEvents(); @@ -541,6 +542,17 @@ export class SessionComponent implements OnInit, OnDestroy { }); } + private subscribeToVirtualBackground() { + this.libService.backgroundEffectsButton$.subscribe(async (enable) => { + if (!enable && this.backgroundService.isBackgroundApplied()) { + await this.backgroundService.removeBackground(); + if (this.panelService.isBackgroundEffectsPanelOpened()) { + this.panelService.closePanel(); + } + } + }); + } + private startUpdateLayoutInterval() { this.updateLayoutInterval = setInterval(() => { this.layoutService.update();