mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Do not show the loader during recordings api call (#6366)
* Do not show the loader during recordings api call Showing the loader during the recordings API call will rerender the recordings list and rerenders the video player * Fix defauting to 0 seekSeconds if recordings results are missings
This commit is contained in:
parent
0fcfcb85ab
commit
17b92aa657
@ -30,7 +30,7 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se
|
||||
// calculates the seek seconds by adding up all the seconds in the segments prior to the playback time
|
||||
const seekSeconds = useMemo(() => {
|
||||
if (!recordings) {
|
||||
return 0;
|
||||
return undefined;
|
||||
}
|
||||
const currentUnix = getUnixTime(currentDate);
|
||||
|
||||
@ -103,6 +103,9 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se
|
||||
}, [playlistIndex]);
|
||||
|
||||
useEffect(() => {
|
||||
if (seekSeconds === undefined) {
|
||||
return;
|
||||
}
|
||||
if (this.player) {
|
||||
// if the playlist has moved on to the next item, then reset
|
||||
if (this.player.playlist.currentItem() !== playlistIndex) {
|
||||
@ -114,7 +117,7 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se
|
||||
}
|
||||
}, [seekSeconds, playlistIndex]);
|
||||
|
||||
if (!recordingsSummary || !recordings || !config) {
|
||||
if (!recordingsSummary || !config) {
|
||||
return <ActivityIndicator />;
|
||||
}
|
||||
|
||||
@ -145,7 +148,9 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se
|
||||
player.playlist(playlist);
|
||||
player.playlist.autoadvance(0);
|
||||
player.playlist.currentItem(playlistIndex);
|
||||
player.currentTime(seekSeconds);
|
||||
if (seekSeconds !== undefined) {
|
||||
player.currentTime(seekSeconds);
|
||||
}
|
||||
this.player = player;
|
||||
}
|
||||
}}
|
||||
|
Loading…
Reference in New Issue
Block a user