mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 17:55:21 +03:00
Clean up camera default values
This commit is contained in:
parent
36fd3de756
commit
70a8ac1f35
@ -29,7 +29,10 @@ export default function Camera({ camera }) {
|
|||||||
const jsmpegWidth = cameraConfig
|
const jsmpegWidth = cameraConfig
|
||||||
? Math.round(cameraConfig.restream.jsmpeg.height * (cameraConfig.detect.width / cameraConfig.detect.height))
|
? Math.round(cameraConfig.restream.jsmpeg.height * (cameraConfig.detect.width / cameraConfig.detect.height))
|
||||||
: 0;
|
: 0;
|
||||||
const [viewSource, setViewSource, sourceIsLoaded] = usePersistence(`${camera}-source`, 'mse');
|
const [viewSource, setViewSource, sourceIsLoaded] = usePersistence(
|
||||||
|
`${camera}-source`,
|
||||||
|
getDefaultLiveMode(config, cameraConfig)
|
||||||
|
);
|
||||||
const sourceValues = cameraConfig && cameraConfig.restream.enabled ? ['mse', 'webrtc', 'jsmpeg'] : ['jsmpeg'];
|
const sourceValues = cameraConfig && cameraConfig.restream.enabled ? ['mse', 'webrtc', 'jsmpeg'] : ['jsmpeg'];
|
||||||
const [options, setOptions] = usePersistence(`${camera}-feed`, emptyObject);
|
const [options, setOptions] = usePersistence(`${camera}-feed`, emptyObject);
|
||||||
|
|
||||||
@ -77,7 +80,13 @@ export default function Camera({ camera }) {
|
|||||||
labelPosition="after"
|
labelPosition="after"
|
||||||
/>
|
/>
|
||||||
<Switch checked={options['zones']} id="zones" onChange={handleSetOption} label="Zones" labelPosition="after" />
|
<Switch checked={options['zones']} id="zones" onChange={handleSetOption} label="Zones" labelPosition="after" />
|
||||||
<Switch checked={options['mask']} id="mask" onChange={handleSetOption} label="Motion Masks" labelPosition="after" />
|
<Switch
|
||||||
|
checked={options['mask']}
|
||||||
|
id="mask"
|
||||||
|
onChange={handleSetOption}
|
||||||
|
label="Motion Masks"
|
||||||
|
labelPosition="after"
|
||||||
|
/>
|
||||||
<Switch
|
<Switch
|
||||||
checked={options['motion']}
|
checked={options['motion']}
|
||||||
id="motion"
|
id="motion"
|
||||||
@ -191,3 +200,15 @@ export default function Camera({ camera }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getDefaultLiveMode(config, cameraConfig) {
|
||||||
|
if (cameraConfig) {
|
||||||
|
if (cameraConfig.restream.enabled) {
|
||||||
|
return config.ui.live_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'jsmpeg';
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user