ov-components: add isPinned getter to determine if participant's video is fixed in UI

master
Carlos Santos 2025-12-22 13:21:32 +01:00
parent f300788c1e
commit ff492a1f22
1 changed files with 11 additions and 3 deletions

View File

@ -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').