feat(call): VideoStub accepts fit prop, contain when focused

This commit is contained in:
byGalax
2026-05-12 18:36:32 +02:00
parent 68bc1f76f6
commit 005aebd60b
@@ -129,7 +129,7 @@ export function CallParticipantTile(props: ParticipantTileProps) {
}
>
{video ? (
<VideoStub {...props} small={small} />
<VideoStub {...props} small={small} fit={focused ? 'contain' : 'cover'} />
) : (
<AudioContent {...props} small={small} />
)}
@@ -303,7 +303,8 @@ function VideoStub({
videoTrack,
me,
small,
}: ParticipantTileProps & { small: boolean }) {
fit,
}: ParticipantTileProps & { small: boolean; fit: 'cover' | 'contain' }) {
const videoRef = useRef<HTMLVideoElement | null>(null);
useEffect(() => {
const el = videoRef.current;
@@ -330,7 +331,8 @@ function VideoStub({
playsInline
muted
className={
'h-full w-full object-cover ' +
'h-full w-full ' +
(fit === 'contain' ? 'object-contain ' : 'object-cover ') +
(me ? 'scale-x-[-1]' : '') /* mirror local preview */
}
/>