From 86ad68a705710c82d61ced6188c9ad3b0e157adf Mon Sep 17 00:00:00 2001 From: yiling Date: Tue, 30 Jun 2026 10:50:30 +0800 Subject: [PATCH] feat(webui): add Fit zoom button in video player control bar --- .../webui/components/viewers/video-player.tsx | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/packages/webui/components/viewers/video-player.tsx b/packages/webui/components/viewers/video-player.tsx index 5cdd6979..97092b2b 100644 --- a/packages/webui/components/viewers/video-player.tsx +++ b/packages/webui/components/viewers/video-player.tsx @@ -79,6 +79,7 @@ interface ControlBarProps { handleDownload: (url: string, resolution: string) => void toggleFullScreen: () => void onZoomChange: (zoom: number) => void + onZoomReset: () => void // Frame-accurate props frameRate: number totalFrames: number @@ -102,6 +103,7 @@ const ControlBar: React.FC = ({ handleDownload, toggleFullScreen, onZoomChange, + onZoomReset, frameRate, totalFrames, currentFrame, @@ -248,19 +250,29 @@ const ControlBar: React.FC = ({ {/* Right Side: Zoom, Speed, Res, Download, Fullscreen */}
{/* Zoom Controls */} -
+
+
+ + + {Math.round(zoom * 100)}% + + +
- {Math.round(zoom * 100)}% -
@@ -384,6 +396,10 @@ const VideoPlayer: React.FC = ({ setHasManuallyZoomed(true) } + const handleZoomReset = () => { + setHasManuallyZoomed(false) + } + // Store const { isDrawing, @@ -926,6 +942,7 @@ const VideoPlayer: React.FC = ({ handleDownload={handleDownload} toggleFullScreen={toggleFullScreen} onZoomChange={handleZoomChange} + onZoomReset={handleZoomReset} frameRate={frameRate} totalFrames={totalFrames} currentFrame={currentFrame}