From 465403f8cb8d799c01c9e51c3670a05a69bb8e92 Mon Sep 17 00:00:00 2001 From: CSantosM <4a.santos@gmail.com> Date: Thu, 22 Jan 2026 12:31:00 +0100 Subject: [PATCH] ov-components: Added getParticipantByIdentity to participantService --- .../lib/services/participant/participant.service.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/services/participant/participant.service.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/services/participant/participant.service.ts index c819767e8..fbf2aa442 100644 --- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/services/participant/participant.service.ts +++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/services/participant/participant.service.ts @@ -460,6 +460,19 @@ export class ParticipantService { } } + + /** + * Returns the participant with the given identity. + * @param identity + * @returns + */ + getParticipantByIdentity(identity: string): ParticipantModel | undefined { + if (this.localParticipant?.identity === identity) { + return this.localParticipant; + } + return this.remoteParticipants.find((p) => p.identity === identity); + } + /* ------------------------------ Remote Participants ------------------------------ */ /**