Skip to content

Commit 185ea7a

Browse files
committed
openvidu-components: Disabled background button with video muted
1 parent a38d6b4 commit 185ea7a

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

openvidu-components-angular/projects/openvidu-angular/src/lib/components/pre-join/pre-join.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
<ov-layout>
1414
<ng-template #stream let-stream>
1515
<button
16-
*ngIf="!isMinimal && !isVideoMuted && showBackgroundEffectsButton"
16+
*ngIf="!isMinimal && showBackgroundEffectsButton"
17+
[disabled]="isVideoMuted"
1718
mat-icon-button
1819
id="background-effects-btn"
1920
(click)="toggleBackgroundEffects()"

openvidu-components-angular/projects/openvidu-angular/src/lib/components/toolbar/toolbar.component.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,13 @@
9393
</button> -->
9494

9595
<!-- Virtual background button -->
96-
<button *ngIf="!isMinimal && showBackgroundEffectsButton" mat-menu-item id="virtual-bg-btn" (click)="toggleBackgroundEffects()">
96+
<button
97+
*ngIf="!isMinimal && showBackgroundEffectsButton"
98+
[disabled]="!isWebcamVideoActive"
99+
mat-menu-item
100+
id="virtual-bg-btn"
101+
(click)="toggleBackgroundEffects()"
102+
>
97103
<mat-icon>auto_awesome</mat-icon>
98104
<span>Background effects</span>
99105
</button>

openvidu-components-angular/projects/openvidu-angular/src/lib/components/toolbar/toolbar.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,9 @@ export class ToolbarComponent implements OnInit, OnDestroy {
403403
this.onCameraButtonClicked.emit();
404404
try {
405405
const publishVideo = !this.participantService.isMyVideoActive();
406+
if(this.panelService.isExternalPanelOpened() && !publishVideo) {
407+
this.panelService.togglePanel(PanelType.BACKGROUND_EFFECTS);
408+
}
406409
await this.openviduService.publishVideo(publishVideo);
407410
} catch (error) {
408411
this.log.e('There was an error toggling camera:', error.code, error.message);

0 commit comments

Comments
 (0)