From 116edce3dce556edd6d708de5c84b618d36eb586 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sat, 28 Jan 2023 07:15:52 -0700 Subject: [PATCH] Set jsmpeg manually when restream is disabled (#5265) --- web/src/routes/Camera.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/routes/Camera.jsx b/web/src/routes/Camera.jsx index 0d3f86df3..e99aa7db5 100644 --- a/web/src/routes/Camera.jsx +++ b/web/src/routes/Camera.jsx @@ -25,7 +25,8 @@ export default function Camera({ camera }) { const [viewMode, setViewMode] = useState('live'); const cameraConfig = config?.cameras[camera]; - const restreamEnabled = cameraConfig && Object.keys(config.go2rtc.streams || {}).includes(cameraConfig.live.stream_name); + const restreamEnabled = + cameraConfig && Object.keys(config.go2rtc.streams || {}).includes(cameraConfig.live.stream_name); const jsmpegWidth = cameraConfig ? Math.round(cameraConfig.live.height * (cameraConfig.detect.width / cameraConfig.detect.height)) : 0; @@ -63,6 +64,10 @@ export default function Camera({ camera }) { return ; } + if (!restreamEnabled) { + setViewSource('jsmpeg'); + } + const optionContent = showSettings ? (