Skip to content

Commit

Permalink
Use variable for preview FPS
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Apr 29, 2024
1 parent 75eeb90 commit d366bdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions web/src/components/player/PreviewThumbnailPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import useContextMenu from "@/hooks/use-contextmenu";
import ActivityIndicator from "../indicators/activity-indicator";
import { TimeRange } from "@/types/timeline";
import { NoThumbSlider } from "../ui/slider";
import { PREVIEW_PADDING } from "@/types/preview";
import { PREVIEW_FPS, PREVIEW_PADDING } from "@/types/preview";

type PreviewPlayerProps = {
review: ReviewSegment;
Expand Down Expand Up @@ -398,7 +398,7 @@ export function VideoPreview({
setManualPlayback(true);
} else {
playerRef.current.currentTime = playerStartTime;
playerRef.current.playbackRate = 8;
playerRef.current.playbackRate = PREVIEW_FPS;
}

// we know that these deps are correct
Expand Down Expand Up @@ -470,7 +470,7 @@ export function VideoPreview({
playerRef.current.currentTime = playerStartTime + counter;
counter += 1;
}
}, 125);
}, 1000 / PREVIEW_FPS);
return () => clearInterval(intervalId);

// we know that these deps are correct
Expand Down
3 changes: 2 additions & 1 deletion web/src/types/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export type Preview = {
end: number;
};

export const PREVIEW_PADDING = REVIEW_PADDING * 2;
export const PREVIEW_FPS = 8;
export const PREVIEW_PADDING = REVIEW_PADDING * PREVIEW_FPS;

0 comments on commit d366bdc

Please sign in to comment.