mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-05 22:57:40 +03:00
Merge pull request #82 from ibs0d/claude/fix-preview-aspect-ratio-GZq8u
fix: preserve aspect ratio in preview players during timeline scrubbing
This commit is contained in:
commit
bd1971301d
@ -281,7 +281,7 @@ function PreviewVideoPlayer({
|
||||
<div
|
||||
ref={visibilityRef}
|
||||
className={cn(
|
||||
"relative flex w-full justify-center overflow-hidden rounded-lg bg-black md:rounded-2xl",
|
||||
"relative flex w-full items-center justify-center overflow-hidden rounded-lg bg-black md:rounded-2xl",
|
||||
onClick && "cursor-pointer",
|
||||
className,
|
||||
)}
|
||||
@ -289,7 +289,7 @@ function PreviewVideoPlayer({
|
||||
onClick={onClick}
|
||||
>
|
||||
<img
|
||||
className={`absolute size-full object-contain ${currentHourFrame ? "visible" : "invisible"}`}
|
||||
className={`max-h-full max-w-full object-contain ${currentHourFrame ? "visible" : "invisible"}`}
|
||||
src={currentHourFrame}
|
||||
onLoad={() => {
|
||||
if (changeoverTimeout) {
|
||||
@ -303,7 +303,7 @@ function PreviewVideoPlayer({
|
||||
{isVisible && (
|
||||
<video
|
||||
ref={previewRef}
|
||||
className={`absolute size-full object-contain ${currentHourFrame ? "invisible" : "visible"}`}
|
||||
className={`max-h-full max-w-full object-contain ${currentHourFrame ? "invisible" : "visible"}`}
|
||||
preload="auto"
|
||||
autoPlay
|
||||
playsInline
|
||||
@ -348,7 +348,7 @@ function PreviewVideoPlayer({
|
||||
{t("noPreviewFoundFor", { camera: cameraName })}
|
||||
</div>
|
||||
)}
|
||||
{firstLoad && <Skeleton className="absolute aspect-video size-full" />}
|
||||
{firstLoad && <Skeleton className="aspect-video w-full" />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -554,7 +554,7 @@ function PreviewFramesPlayer({
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"relative flex w-full justify-center",
|
||||
"relative flex w-full items-center justify-center",
|
||||
className,
|
||||
onClick && "cursor-pointer",
|
||||
)}
|
||||
@ -562,7 +562,7 @@ function PreviewFramesPlayer({
|
||||
>
|
||||
<img
|
||||
ref={imgRef}
|
||||
className={`size-full rounded-lg bg-black object-contain md:rounded-2xl`}
|
||||
className="max-h-full max-w-full rounded-lg object-contain md:rounded-2xl"
|
||||
loading="lazy"
|
||||
onLoad={onImageLoaded}
|
||||
/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user