forked from Github/frigate
Improve desktop timeline view (#9150)
* Break apart mobile and desktop timeline views * Set aspect ratio for player correctly * more modest default width * Add timeline item card * Get video player to fit * get layout going * More work on youtube view * Get video scaling working * Better dialog sizes * Show all timelines for day * Add full day of timelines * Improve hooks * Fix previews * Separate mobile and desktop views and don't rerender * cleanup * Optimizations and improvements * make preview dates more efficient * Remove seekbar and use timeline as seekbar * Improve background and scrubbing
This commit is contained in:
committed by
Blake Blackshear
parent
0ee81c7526
commit
160e331035
@@ -186,8 +186,8 @@ function PreviewContent({
|
||||
|
||||
const touchEnd = new Date().getTime();
|
||||
|
||||
// consider tap less than 500 ms
|
||||
if (touchEnd - touchStart < 500) {
|
||||
// consider tap less than 300 ms
|
||||
if (touchEnd - touchStart < 300) {
|
||||
onClick();
|
||||
}
|
||||
});
|
||||
@@ -214,10 +214,11 @@ function PreviewContent({
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
<div className={`${getPreviewWidth(camera, config)}`}>
|
||||
<div className="w-full">
|
||||
<VideoPlayer
|
||||
options={{
|
||||
preload: "auto",
|
||||
aspectRatio: "16:9",
|
||||
autoplay: true,
|
||||
controls: false,
|
||||
muted: true,
|
||||
@@ -263,12 +264,12 @@ function isCurrentHour(timestamp: number) {
|
||||
function getPreviewWidth(camera: string, config: FrigateConfig) {
|
||||
const detect = config.cameras[camera].detect;
|
||||
|
||||
if (detect.width / detect.height < 1.0) {
|
||||
return "w-[120px]";
|
||||
if (detect.width / detect.height < 1) {
|
||||
return "w-1/2";
|
||||
}
|
||||
|
||||
if (detect.width / detect.height < 1.4) {
|
||||
return "w-[208px]";
|
||||
if (detect.width / detect.height < 16 / 9) {
|
||||
return "w-2/3";
|
||||
}
|
||||
|
||||
return "w-full";
|
||||
|
||||
Reference in New Issue
Block a user