mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix Webui Default Stream (#5455)
* Pass restream enabled * Use livemode for birdseye as well
This commit is contained in:
parent
c74c9ff161
commit
3d90366af2
@ -10,7 +10,10 @@ import useSWR from 'swr';
|
||||
export default function Birdseye() {
|
||||
const { data: config } = useSWR('config');
|
||||
|
||||
const [viewSource, setViewSource, sourceIsLoaded] = usePersistence('birdseye-source', 'mse');
|
||||
const [viewSource, setViewSource, sourceIsLoaded] = usePersistence(
|
||||
'birdseye-source',
|
||||
getDefaultLiveMode(config)
|
||||
);
|
||||
const sourceValues = ['mse', 'webrtc', 'jsmpeg'];
|
||||
|
||||
if (!config || !sourceIsLoaded) {
|
||||
@ -80,3 +83,16 @@ export default function Birdseye() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function getDefaultLiveMode(config) {
|
||||
if (config) {
|
||||
if (config.birdseye.restream) {
|
||||
return config.ui.live_mode;
|
||||
}
|
||||
|
||||
return 'jsmpeg';
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ export default function Camera({ camera }) {
|
||||
: 0;
|
||||
const [viewSource, setViewSource, sourceIsLoaded] = usePersistence(
|
||||
`${camera}-source`,
|
||||
getDefaultLiveMode(config, cameraConfig)
|
||||
getDefaultLiveMode(config, cameraConfig, restreamEnabled)
|
||||
);
|
||||
const sourceValues = restreamEnabled ? ['mse', 'webrtc', 'jsmpeg'] : ['jsmpeg'];
|
||||
const [options, setOptions] = usePersistence(`${camera}-feed`, emptyObject);
|
||||
|
Loading…
Reference in New Issue
Block a user