mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-13 12:17:24 +00:00
38c131e02c
The core component of the PiP layout. Adapted from a simplified version of @ovgodd's work in #890 — see that PR for context on the original design. Co-authored-by: Cyril <c.gromoff@gmail.com>
17 lines
532 B
TypeScript
17 lines
532 B
TypeScript
import {
|
|
isTrackReference,
|
|
TrackReferenceOrPlaceholder,
|
|
} from '@livekit/components-core'
|
|
|
|
/**
|
|
* Produces a stable React key for a track so resizes/reshuffles of the grid
|
|
* do not remount the underlying <video> element.
|
|
*/
|
|
export const getTrackKey = (track: TrackReferenceOrPlaceholder): string => {
|
|
const identity = track.participant?.identity ?? 'unknown'
|
|
if (isTrackReference(track)) {
|
|
return `${identity}::${track.source}::${track.publication.trackSid}`
|
|
}
|
|
return `${identity}::${track.source}::placeholder`
|
|
}
|