Add option for live mode & timezone config, fix MSE check for iPad (#5079)

* Add config fields

* Clean up camera default values

* Set recordings timezone with config if available

* Adjust for timezone config

* Cleanup setting of the timezone

* Don't fail on MSE check iPad

* Fix MSE check for birdseye

* Add docs

* Fix test
This commit is contained in:
Nicolas Mowen
2023-01-13 16:27:16 -07:00
committed by GitHub
parent 170899bd71
commit e0b3b27b8a
6 changed files with 64 additions and 19 deletions

View File

@@ -9,7 +9,8 @@ import { useApiHost } from '../api';
import useSWR from 'swr';
export default function Recording({ camera, date, hour = '00', minute = '00', second = '00' }) {
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const { data: config } = useSWR('config');
let timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const currentDate = useMemo(
() => (date ? parseISO(`${date}T${hour || '00'}:${minute || '00'}:${second || '00'}`) : new Date()),
[date, hour, minute, second]
@@ -113,10 +114,14 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se
}
}, [seekSeconds, playlistIndex]);
if (!recordingsSummary || !recordings) {
if (!recordingsSummary || !recordings || !config) {
return <ActivityIndicator />;
}
if (config.ui.timezone) {
timezone = config.ui.timezone;
}
if (recordingsSummary.length === 0) {
return (
<div className="space-y-4">