Fixes & Tweaks (#14013)

* Rework to create util for onnx initialization

* Fix shm log

* Fix onClick exceptoins
This commit is contained in:
Nicolas Mowen
2024-09-27 07:41:48 -06:00
committed by GitHub
parent c0bd3b362c
commit 05fe7f8a48
4 changed files with 59 additions and 35 deletions

View File

@@ -154,6 +154,7 @@ export default function HlsVideoPlayer({
const [mobileCtrlTimeout, setMobileCtrlTimeout] = useState<NodeJS.Timeout>();
const [controls, setControls] = useState(isMobile);
const [controlsOpen, setControlsOpen] = useState(false);
const [zoomScale, setZoomScale] = useState(1.0);
useEffect(() => {
if (!isDesktop) {
@@ -185,7 +186,11 @@ export default function HlsVideoPlayer({
}, [videoRef, controlsOpen]);
return (
<TransformWrapper minScale={1.0} wheel={{ smoothStep: 0.005 }}>
<TransformWrapper
minScale={1.0}
wheel={{ smoothStep: 0.005 }}
onZoom={(zoom) => setZoomScale(zoom.state.scale)}
>
{frigateControls && (
<VideoControls
className={cn(
@@ -267,7 +272,13 @@ export default function HlsVideoPlayer({
controls={!frigateControls}
playsInline
muted={muted}
onClick={() => onPlayPause(!isPlaying)}
onClick={
isDesktop
? () => {
if (zoomScale == 1.0) onPlayPause(!isPlaying);
}
: undefined
}
onVolumeChange={() =>
setVolume(videoRef.current?.volume ?? 1.0, true)
}