From 1f6f151ce24f1c062d4d6a5b20080b318c5d9ab8 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Fri, 24 Feb 2023 20:26:48 +0100 Subject: [PATCH] openvidu-components: Improved the way to create participant reference --- .../lib/services/participant/participant.service.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 49de1c36..be844b5c 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 @@ -2,7 +2,13 @@ import { Injectable } from '@angular/core'; import { Publisher, Subscriber } from 'openvidu-browser'; import { BehaviorSubject, Observable } from 'rxjs'; import { ILogger } from '../../models/logger.model'; -import { OpenViduRole, ParticipantAbstractModel, ParticipantModel, ParticipantProperties, StreamModel } from '../../models/participant.model'; +import { + OpenViduRole, + ParticipantAbstractModel, + ParticipantModel, + ParticipantProperties, + StreamModel +} from '../../models/participant.model'; import { VideoType } from '../../models/video-type.model'; import { OpenViduAngularConfigService } from '../config/openvidu-angular.config.service'; import { LoggerService } from '../logger/logger.service'; @@ -241,7 +247,9 @@ export class ParticipantService { * Force to update the local participant object and fire a new {@link localParticipantObs} Observable event. */ updateLocalParticipant() { - this._localParticipant.next(Object.assign(Object.create(this.localParticipant), this.localParticipant)); + this._localParticipant.next( + Object.assign(Object.create(Object.getPrototypeOf(this.localParticipant)), { ...this.localParticipant }) + ); } /**