mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components-angular: manage some incompatible VB situations
parent
7832f5a75f
commit
279da4eeaf
|
@ -43,13 +43,11 @@ export class BackgroundEffectsPanelComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
async applyBackground(effect: BackgroundEffect) {
|
async applyBackground(effect: BackgroundEffect) {
|
||||||
|
|
||||||
if (effect.type === EffectType.NONE) {
|
if (effect.type === EffectType.NONE) {
|
||||||
await this.removeBackground();
|
await this.removeBackground();
|
||||||
} else {
|
} else {
|
||||||
await this.backgroundService.applyBackground(effect);
|
await this.backgroundService.applyBackground(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeBackground() {
|
async removeBackground() {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<ov-layout>
|
<ov-layout>
|
||||||
<ng-template #stream let-stream>
|
<ng-template #stream let-stream>
|
||||||
<button
|
<button
|
||||||
*ngIf="!isMinimal && showBackgroundEffectsButton"
|
*ngIf="!isMinimal && !isVideoMuted && showBackgroundEffectsButton"
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
id="background-effects-btn"
|
id="background-effects-btn"
|
||||||
(click)="toggleBackgroundEffects()"
|
(click)="toggleBackgroundEffects()"
|
||||||
|
|
|
@ -122,8 +122,16 @@ export class PreJoinComponent implements OnInit, OnDestroy {
|
||||||
// TODO: Remove this when replaceTrack issue is fixed
|
// TODO: Remove this when replaceTrack issue is fixed
|
||||||
const pp: PublisherProperties = { videoSource, audioSource: this.microphoneSelected.device, mirror };
|
const pp: PublisherProperties = { videoSource, audioSource: this.microphoneSelected.device, mirror };
|
||||||
|
|
||||||
|
// Reapply Virtual Background to new Publisher if necessary
|
||||||
|
const backgroundSelected = this.backgroundService.backgroundSelected.getValue();
|
||||||
|
const backgroundWasApplied = !!backgroundSelected && backgroundSelected !== 'no_effect';
|
||||||
|
if (backgroundWasApplied) {
|
||||||
await this.backgroundService.removeBackground();
|
await this.backgroundService.removeBackground();
|
||||||
|
}
|
||||||
await this.openviduService.republishTrack(pp);
|
await this.openviduService.republishTrack(pp);
|
||||||
|
if (backgroundWasApplied) {
|
||||||
|
await this.backgroundService.applyBackground(this.backgroundService.backgrounds.find(b => b.id === backgroundSelected));
|
||||||
|
}
|
||||||
|
|
||||||
this.deviceSrv.setCameraSelected(videoSource);
|
this.deviceSrv.setCameraSelected(videoSource);
|
||||||
this.cameraSelected = this.deviceSrv.getCameraSelected();
|
this.cameraSelected = this.deviceSrv.getCameraSelected();
|
||||||
|
@ -152,6 +160,9 @@ export class PreJoinComponent implements OnInit, OnDestroy {
|
||||||
await this.openviduService.publishVideo(publish);
|
await this.openviduService.publishVideo(publish);
|
||||||
this.isVideoMuted = !this.isVideoMuted;
|
this.isVideoMuted = !this.isVideoMuted;
|
||||||
this.storageSrv.setVideoMuted(this.isVideoMuted);
|
this.storageSrv.setVideoMuted(this.isVideoMuted);
|
||||||
|
if (this.isVideoMuted && this.panelService.isExternalPanelOpened()) {
|
||||||
|
this.panelService.togglePanel(PanelType.BACKGROUND_EFFECTS);
|
||||||
|
}
|
||||||
this.videoMuteChanging = false;
|
this.videoMuteChanging = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ export class PanelService {
|
||||||
return this.isParticipantsOpened;
|
return this.isParticipantsOpened;
|
||||||
}
|
}
|
||||||
|
|
||||||
private isExternalPanelOpened(): boolean {
|
isExternalPanelOpened(): boolean {
|
||||||
return this.isExternalOpened;
|
return this.isExternalOpened;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue