mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-08 20:25:26 +03:00
ensure lockout is engaged when starting
This commit is contained in:
parent
92116dcc6a
commit
e6d5cdedfd
@ -306,7 +306,7 @@ export class DynamicVideoController {
|
||||
undefined;
|
||||
private annotationOffset: number;
|
||||
private timeToStart: number | undefined = undefined;
|
||||
private clipChangeLockout: boolean = false;
|
||||
private clipChangeLockout: boolean = true;
|
||||
|
||||
// preview
|
||||
private preview: Preview | undefined = undefined;
|
||||
|
||||
@ -525,6 +525,7 @@ function MotionReview({
|
||||
}: MotionReviewProps) {
|
||||
const segmentDuration = 30;
|
||||
const { data: config } = useSWR<FrigateConfig>("config");
|
||||
const [playerReady, setPlayerReady] = useState(false);
|
||||
|
||||
const reviewCameras = useMemo(() => {
|
||||
if (!config) {
|
||||
@ -569,12 +570,17 @@ function MotionReview({
|
||||
|
||||
// move to next clip
|
||||
useEffect(() => {
|
||||
if (!videoPlayersRef.current) {
|
||||
if (
|
||||
!videoPlayersRef.current &&
|
||||
Object.values(videoPlayersRef.current).length > 0
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
Object.values(videoPlayersRef.current).forEach((controller) => {
|
||||
controller.onClipChangedEvent((dir) => {
|
||||
const firstController = Object.values(videoPlayersRef.current)[0];
|
||||
|
||||
if (firstController) {
|
||||
firstController.onClipChangedEvent((dir) => {
|
||||
if (
|
||||
dir == "forward" &&
|
||||
selectedRangeIdx < timeRangeSegments.ranges.length - 1
|
||||
@ -584,8 +590,8 @@ function MotionReview({
|
||||
setSelectedRangeIdx(selectedRangeIdx - 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
}, [selectedRangeIdx, timeRangeSegments]);
|
||||
}
|
||||
}, [selectedRangeIdx, timeRangeSegments, videoPlayersRef, playerReady]);
|
||||
|
||||
useEffect(() => {
|
||||
Object.values(videoPlayersRef.current).forEach((controller) => {
|
||||
@ -618,6 +624,7 @@ function MotionReview({
|
||||
defaultMode="scrubbing"
|
||||
onControllerReady={(controller) => {
|
||||
videoPlayersRef.current[camera.name] = controller;
|
||||
setPlayerReady(true);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user