diff --git a/web/src/routes/Camera_V2.jsx b/web/src/routes/Camera_V2.jsx index 5326f9208..891510d2c 100644 --- a/web/src/routes/Camera_V2.jsx +++ b/web/src/routes/Camera_V2.jsx @@ -14,24 +14,6 @@ export default function Camera({ camera }) { const [playerType, setPlayerType] = useState('live'); const cameraConfig = config?.cameras[camera]; - const liveWidth = Math.round(cameraConfig.live.height * (cameraConfig.detect.width / cameraConfig.detect.height)); - - const RenderPlayer = () => { - if (playerType === 'live') { - return ( - -
- -
-
- ); - } else if (playerType === 'history') { - return ; - } else if (playerType === 'debug') { - return ; - } - return ; - }; const handleTabChange = (index) => { if (index === 0) { @@ -60,7 +42,7 @@ export default function Camera({ camera }) {
- +
@@ -74,3 +56,21 @@ export default function Camera({ camera }) {
); } + +const RenderPlayer = function ({ camera, cameraConfig, playerType }) { + const liveWidth = Math.round(cameraConfig.live.height * (cameraConfig.detect.width / cameraConfig.detect.height)); + if (playerType === 'live') { + return ( + +
+ +
+
+ ); + } else if (playerType === 'history') { + return ; + } else if (playerType === 'debug') { + return ; + } + return ; +};