Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI changes #11863

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/src/components/card/AnimatedEventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export function AnimatedEventCard({
// image behavior

const aspectRatio = useMemo(() => {
if (!config) {
return 1;
if (!config || !Object.keys(config.cameras).includes(event.camera)) {
return 16 / 9;
}

const detect = config.cameras[event.camera].detect;
Expand Down
7 changes: 4 additions & 3 deletions web/src/components/player/LivePlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function LivePlayer({
}

if (!cameraActive) {
setLiveReady(false);
setTimeout(() => setLiveReady(false), 500);
}
// live mode won't change
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand All @@ -94,7 +94,7 @@ export default function LivePlayer({
// camera still state

const stillReloadInterval = useMemo(() => {
if (!windowVisible || offline) {
if (!windowVisible || offline || !showStillWithoutActivity) {
return -1; // no reason to update the image when the window is not visible
}

Expand All @@ -113,6 +113,7 @@ export default function LivePlayer({
return 30000;
}, [
autoLive,
showStillWithoutActivity,
liveReady,
activeMotion,
activeTracking,
Expand Down Expand Up @@ -252,7 +253,7 @@ export default function LivePlayer({
camera={cameraConfig.name}
showFps={false}
reloadInterval={stillReloadInterval}
cameraClasses="relative w-full h-full flex justify-center"
cameraClasses="relative size-full flex justify-center"
/>
</div>

Expand Down
Loading