summaryrefslogtreecommitdiff
path: root/apps/web/src/stores/playback-store.ts
diff options
context:
space:
mode:
authorZaka <149817565+ZakaHaceCosas@users.noreply.github.com>2025-08-15 23:01:18 +0200
committerGitHub <noreply@github.com>2025-08-15 23:01:18 +0200
commit7e4cd767622e3e1a09e76770ce800f4a541cf0e8 (patch)
treea7cc92bc6d1fe1686da096cb67e308cedc731f5a /apps/web/src/stores/playback-store.ts
parent033a9aa1bcc06ee82d611ac2c7deb5575c2fa803 (diff)
downloadopencut-7e4cd767622e3e1a09e76770ce800f4a541cf0e8.tar.gz
feat: add an input so the user can go to a specific timestamp (#530)
* feat: add an input so the user can go to a specific timestamp * fix: use TimeCode type for EditableTimecodeProps * cleanup --------- Co-authored-by: Maze Winther <mazewinther@gmail.com>
Diffstat (limited to 'apps/web/src/stores/playback-store.ts')
-rw-r--r--apps/web/src/stores/playback-store.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/web/src/stores/playback-store.ts b/apps/web/src/stores/playback-store.ts
index a92cb530..c2b9cf4a 100644
--- a/apps/web/src/stores/playback-store.ts
+++ b/apps/web/src/stores/playback-store.ts
@@ -1,7 +1,7 @@
import { create } from "zustand";
import type { PlaybackState, PlaybackControls } from "@/types/playback";
import { useTimelineStore } from "@/stores/timeline-store";
-import { useProjectStore } from "./project-store";
+import { DEFAULT_FPS, useProjectStore } from "./project-store";
interface PlaybackStore extends PlaybackState, PlaybackControls {
setDuration: (duration: number) => void;
@@ -37,9 +37,9 @@ const startTimer = (store: () => PlaybackStore) => {
// When content completes, pause just before the end so we can see the last frame
const projectFps = useProjectStore.getState().activeProject?.fps;
if (!projectFps)
- console.error("Project FPS is not set, assuming 30fps");
+ console.error("Project FPS is not set, assuming " + DEFAULT_FPS + "fps");
- const frameOffset = 1 / (projectFps ?? 30); // Stop 1 frame before end based on project FPS
+ const frameOffset = 1 / (projectFps ?? DEFAULT_FPS); // Stop 1 frame before end based on project FPS
const stopTime = Math.max(0, effectiveDuration - frameOffset);
state.pause();
@@ -91,7 +91,7 @@ export const usePlaybackStore = create<PlaybackStore>((set, get) => ({
actualContentDuration > 0 ? actualContentDuration : state.duration;
if (effectiveDuration > 0) {
- const fps = useProjectStore.getState().activeProject?.fps ?? 30;
+ const fps = useProjectStore.getState().activeProject?.fps ?? DEFAULT_FPS;
const frameOffset = 1 / fps;
const endThreshold = Math.max(0, effectiveDuration - frameOffset);