mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 11:45:24 +03:00
Set aspect ratio for player correctly
This commit is contained in:
parent
6807400314
commit
5e2225b8ac
@ -214,10 +214,11 @@ function PreviewContent({
|
|||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`${getPreviewWidth(camera, config)}`}>
|
<div className="w-full">
|
||||||
<VideoPlayer
|
<VideoPlayer
|
||||||
options={{
|
options={{
|
||||||
preload: "auto",
|
preload: "auto",
|
||||||
|
aspectRatio: "16:9",
|
||||||
autoplay: true,
|
autoplay: true,
|
||||||
controls: false,
|
controls: false,
|
||||||
muted: true,
|
muted: true,
|
||||||
@ -263,12 +264,12 @@ function isCurrentHour(timestamp: number) {
|
|||||||
function getPreviewWidth(camera: string, config: FrigateConfig) {
|
function getPreviewWidth(camera: string, config: FrigateConfig) {
|
||||||
const detect = config.cameras[camera].detect;
|
const detect = config.cameras[camera].detect;
|
||||||
|
|
||||||
if (detect.width / detect.height < 1.0) {
|
if (detect.width / detect.height < 1) {
|
||||||
return "w-[120px]";
|
return "w-1/2";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detect.width / detect.height < 1.4) {
|
if (detect.width / detect.height < 16 / 9) {
|
||||||
return "w-[208px]";
|
return "w-2/3";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "w-full";
|
return "w-full";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user