openvidu-components: Fixed bug when toggling audio in with screenshare

pull/713/head
csantosm 2022-03-30 11:58:35 +02:00
parent 06f1fcbee1
commit af3c21742f
2 changed files with 9 additions and 8 deletions

View File

@ -12,10 +12,10 @@
mat-icon-button
(click)="toggleMicrophone()"
[disabled]="isConnectionLost || !hasAudioDevices"
[class.warn-btn]="!isWebcamAudioActive"
[class.warn-btn]="!isAudioActive"
>
<mat-icon *ngIf="isWebcamAudioActive" matTooltip="Mute your audio" id="mic">mic</mat-icon>
<mat-icon *ngIf="!isWebcamAudioActive" matTooltip="Unmute your audio" id="mic_off">mic_off</mat-icon>
<mat-icon *ngIf="isAudioActive" matTooltip="Mute your audio" id="mic">mic</mat-icon>
<mat-icon *ngIf="!isAudioActive" matTooltip="Unmute your audio" id="mic_off">mic_off</mat-icon>
</button>
<!-- Camera button -->

View File

@ -28,6 +28,7 @@ import { ParticipantService } from '../../services/participant/participant.servi
import { MenuType } from '../../models/menu.model';
import { OpenViduAngularConfigService } from '../../services/config/openvidu-angular.config.service';
import { ToolbarAdditionalButtonsDirective } from '../../directives/template/openvidu-angular.directive';
import { ParticipantAbstractModel } from '../../models/participant.model';
/**
*
@ -138,7 +139,7 @@ export class ToolbarComponent implements OnInit, OnDestroy {
/**
* @ignore
*/
isWebcamAudioActive: boolean;
isAudioActive: boolean;
/**
* @ignore
*/
@ -293,10 +294,10 @@ export class ToolbarComponent implements OnInit, OnDestroy {
this.participantService.getMyCameraPublisher(),
!this.participantService.hasCameraAudioActive()
);
return;
}
} else {
this.openviduService.publishAudio(this.participantService.getMyScreenPublisher(), !this.participantService.hasScreenAudioActive());
}
}
/**
* @ignore
@ -480,10 +481,10 @@ export class ToolbarComponent implements OnInit, OnDestroy {
});
}
protected subscribeToUserMediaProperties() {
this.localParticipantSubscription = this.participantService.localParticipantObs.subscribe((p) => {
this.localParticipantSubscription = this.participantService.localParticipantObs.subscribe((p: ParticipantAbstractModel) => {
if (p) {
this.isWebcamVideoActive = p.isCameraVideoActive();
this.isWebcamAudioActive = p.isCameraAudioActive();
this.isAudioActive = p.isCameraAudioActive() || p.isScreenAudioActive();
this.isScreenShareActive = p.isScreenActive();
this.cd.markForCheck();
}