ov-components: add subscription for virtual background effects management

master
Carlos Santos 2025-07-04 15:55:22 +02:00
parent 388981be31
commit 1be876678c
1 changed files with 12 additions and 0 deletions

View File

@ -204,6 +204,7 @@ export class SessionComponent implements OnInit, OnDestroy {
// this.subscribeToParticipantNameChanged(); // this.subscribeToParticipantNameChanged();
this.subscribeToDataMessage(); this.subscribeToDataMessage();
this.subscribeToReconnection(); this.subscribeToReconnection();
this.subscribeToVirtualBackground();
if (this.libService.isRecordingEnabled()) { if (this.libService.isRecordingEnabled()) {
// this.subscribeToRecordingEvents(); // 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() { private startUpdateLayoutInterval() {
this.updateLayoutInterval = setInterval(() => { this.updateLayoutInterval = setInterval(() => {
this.layoutService.update(); this.layoutService.update();