mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-04 10:15:22 +03:00
Use livemode for birdseye as well
This commit is contained in:
parent
8a9ac99016
commit
86e086e5d9
@ -10,7 +10,10 @@ import useSWR from 'swr';
|
|||||||
export default function Birdseye() {
|
export default function Birdseye() {
|
||||||
const { data: config } = useSWR('config');
|
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'];
|
const sourceValues = ['mse', 'webrtc', 'jsmpeg'];
|
||||||
|
|
||||||
if (!config || !sourceIsLoaded) {
|
if (!config || !sourceIsLoaded) {
|
||||||
@ -80,3 +83,16 @@ export default function Birdseye() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getDefaultLiveMode(config) {
|
||||||
|
if (config) {
|
||||||
|
if (config.birdseye.restream) {
|
||||||
|
return config.ui.live_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'jsmpeg';
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user