diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.ts index aa725013..3421b963 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/participants-panel/participant-panel-item/participant-panel-item.component.ts @@ -3,6 +3,7 @@ import { Subscription } from 'rxjs'; import { ParticipantPanelItemElementsDirective } from '../../../../directives/template/openvidu-angular.directive'; import { ParticipantAbstractModel } from '../../../../models/participant.model'; 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 */ - constructor(private libService: OpenViduAngularConfigService, private cd: ChangeDetectorRef) {} + constructor(private libService: OpenViduAngularConfigService, protected participantService: ParticipantService, private cd: ChangeDetectorRef) {} ngOnInit(): void { this.subscribeToParticipantPanelItemDirectives(); @@ -108,7 +109,7 @@ export class ParticipantPanelItemComponent implements OnInit, OnDestroy { * @ignore */ toggleMuteForcibly() { - this._participant.setMutedForcibly(!this._participant.isMutedForcibly); + this.participantService.setRemoteMutedForcibly(this._participant.id, !this._participant.isMutedForcibly); } private subscribeToParticipantPanelItemDirectives() { diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/stream/stream.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/stream/stream.component.ts index 18f0c693..37e7f7ad 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/stream/stream.component.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/stream/stream.component.ts @@ -205,7 +205,7 @@ export class StreamComponent implements OnInit { * @ignore */ toggleMuteForcibly() { - this._stream.participant.setMutedForcibly(!this._stream.participant.isMutedForcibly); + this.participantService.setRemoteMutedForcibly(this._stream.participant.id, !this._stream.participant.isMutedForcibly); } /** diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/services/participant/participant.service.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/services/participant/participant.service.ts index cd1f9730..64614bb2 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/services/participant/participant.service.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/services/participant/participant.service.ts @@ -379,7 +379,15 @@ export class ParticipantService { const participant = this.getRemoteParticipantByConnectionId(connectionId); if (participant) { participant.setNickname(nickname); - // this.updateRemoteParticipants(); + this.updateRemoteParticipants(); + } + } + + setRemoteMutedForcibly(id: string, value: boolean) { + const participant = this.getRemoteParticipantById(id); + if (participant) { + participant.setMutedForcibly(value); + this.updateRemoteParticipants(); } }