openvidu-components: Fixed bug muting remote participant

pull/713/head
csantosm 2022-04-01 11:05:25 +02:00
parent 09248b2b45
commit e252b84740
3 changed files with 13 additions and 4 deletions

View File

@ -3,6 +3,7 @@ import { Subscription } from 'rxjs';
import { ParticipantPanelItemElementsDirective } from '../../../../directives/template/openvidu-angular.directive'; import { ParticipantPanelItemElementsDirective } from '../../../../directives/template/openvidu-angular.directive';
import { ParticipantAbstractModel } from '../../../../models/participant.model'; import { ParticipantAbstractModel } from '../../../../models/participant.model';
import { OpenViduAngularConfigService } from '../../../../services/config/openvidu-angular.config.service'; import { OpenViduAngularConfigService } from '../../../../services/config/openvidu-angular.config.service';
import { ParticipantService } from '../../../../services/participant/participant.service';
/** /**
* *
@ -95,7 +96,7 @@ export class ParticipantPanelItemComponent implements OnInit, OnDestroy {
/** /**
* @ignore * @ignore
*/ */
constructor(private libService: OpenViduAngularConfigService, private cd: ChangeDetectorRef) {} constructor(private libService: OpenViduAngularConfigService, protected participantService: ParticipantService, private cd: ChangeDetectorRef) {}
ngOnInit(): void { ngOnInit(): void {
this.subscribeToParticipantPanelItemDirectives(); this.subscribeToParticipantPanelItemDirectives();
@ -108,7 +109,7 @@ export class ParticipantPanelItemComponent implements OnInit, OnDestroy {
* @ignore * @ignore
*/ */
toggleMuteForcibly() { toggleMuteForcibly() {
this._participant.setMutedForcibly(!this._participant.isMutedForcibly); this.participantService.setRemoteMutedForcibly(this._participant.id, !this._participant.isMutedForcibly);
} }
private subscribeToParticipantPanelItemDirectives() { private subscribeToParticipantPanelItemDirectives() {

View File

@ -205,7 +205,7 @@ export class StreamComponent implements OnInit {
* @ignore * @ignore
*/ */
toggleMuteForcibly() { toggleMuteForcibly() {
this._stream.participant.setMutedForcibly(!this._stream.participant.isMutedForcibly); this.participantService.setRemoteMutedForcibly(this._stream.participant.id, !this._stream.participant.isMutedForcibly);
} }
/** /**

View File

@ -379,7 +379,15 @@ export class ParticipantService {
const participant = this.getRemoteParticipantByConnectionId(connectionId); const participant = this.getRemoteParticipantByConnectionId(connectionId);
if (participant) { if (participant) {
participant.setNickname(nickname); participant.setNickname(nickname);
// this.updateRemoteParticipants(); this.updateRemoteParticipants();
}
}
setRemoteMutedForcibly(id: string, value: boolean) {
const participant = this.getRemoteParticipantById(id);
if (participant) {
participant.setMutedForcibly(value);
this.updateRemoteParticipants();
} }
} }