From ff492a1f22827730f25d976a00cc17579ebf7eea Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Mon, 22 Dec 2025 13:21:32 +0100 Subject: [PATCH] ov-components: add isPinned getter to determine if participant's video is fixed in UI --- .../src/lib/models/participant.model.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts index c7e6cfbb3..f4170f938 100644 --- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts +++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts @@ -1,4 +1,3 @@ -import { DeviceType } from './device.model'; import { AudioCaptureOptions, DataPublishOptions, @@ -11,9 +10,9 @@ import { Track, TrackPublication, TrackPublishOptions, - VideoCaptureOptions, - VideoPresets + VideoCaptureOptions } from 'livekit-client'; +import { DeviceType } from './device.model'; export interface ParticipantLeftEvent { roomName: string; @@ -508,6 +507,15 @@ export class ParticipantModel { } } + /** + * Gets whether this participant is pinned. + * This indicates that the participant's video is fixed in place in the UI. + * @returns boolean + */ + get isPinned(): boolean { + return this.tracks.some((track) => track.isPinned); + } + /** * Sets all video track elements from a specific source to pinned or unpinned given a boolean value * @param source The source of the track to be pinned or unpinned (e.g., 'camera', 'screenShare').