Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

Keep paused and reversed animatic clips on the exact frame

Claude2d99718e8fa7
diff --git a/client/src/components/musicVideo/StoryboardAnimatic.jsx b/client/src/components/musicVideo/StoryboardAnimatic.jsx
index ef71bda470..a99b8b307b 100644
--- a/client/src/components/musicVideo/StoryboardAnimatic.jsx
+++ b/client/src/components/musicVideo/StoryboardAnimatic.jsx
@@ -249,8 +249,12 @@ function ShotClip({ scene, audioRef, time, current, preload = 'auto' }) {
// A browser cannot play a clip backwards, so a reversed clip stays paused and is stepped to each frame.
const reversed = clipReversed(scene);
const tolerance = current && (audio.paused || reversed) ? CLIP_PAUSED_DRIFT_SEC : CLIP_DRIFT_SEC;
- // A clip still seeking, or still fetching after its last seek, is left to land; its `seeked` re-checks it.
- const settling = video.seeking || (video.readyState < 3 && performance.now() - recovery.current.lastSeekAt < CLIP_RESEEK_WAIT_MS);
+ // A clip still seeking is left to land; its `seeked` re-checks it. A clip playing forward
+ // that is still fetching after its last seek gets a moment too. Paused or reversed, it must
+ // show the exact frame, so it moves at once.
+ const fetching = current && !audio.paused && !reversed && video.readyState < 3
+ && performance.now() - recovery.current.lastSeekAt < CLIP_RESEEK_WAIT_MS;
+ const settling = video.seeking || fetching;
if (Math.abs((video.currentTime || 0) - target) > tolerance && !settling) {
video.currentTime = target;
recovery.current.lastSeekAt = performance.now();
diff --git a/client/src/components/musicVideo/StoryboardAnimatic.test.jsx b/client/src/components/musicVideo/StoryboardAnimatic.test.jsx
index ca36c26093..2a6c2d7a40 100644
--- a/client/src/components/musicVideo/StoryboardAnimatic.test.jsx
+++ b/client/src/components/musicVideo/StoryboardAnimatic.test.jsx
@@ -202,6 +202,21 @@ describe('StoryboardAnimatic clips', () => {
expect(clip.currentTime).toBeCloseTo(4, 6);
});
+ it('steps a paused clip to each frame while it is still fetching', async () => {
+ render(<StoryboardAnimatic project={{ id: 'p', scenes: clipScenes }} audioUrl="/song.mp3" />);
+ const clip = await screen.findByLabelText('Clip for Opening');
+ await waitFor(() => expect(clip.getAttribute('src')).toBe('/data/videos/clip-a.mov'));
+ clip.pause = vi.fn();
+ const audio = screen.getByLabelText('Song for the storyboard animatic');
+ Object.defineProperty(audio, 'paused', { value: true, configurable: true });
+ Object.defineProperty(clip, 'readyState', { value: 2, configurable: true });
+ const at = (t) => { Object.defineProperty(audio, 'currentTime', { value: t, configurable: true }); fireEvent.timeUpdate(audio); };
+ at(3);
+ expect(clip.currentTime).toBeCloseTo(3, 6);
+ at(3.5);
+ expect(clip.currentTime).toBeCloseTo(3.5, 6);
+ });
+
it('tries a clip that fails to load again', async () => {
render(<StoryboardAnimatic project={{ id: 'p', scenes: clipScenes }} audioUrl="/song.mp3" />);
const clip = await screen.findByLabelText('Clip for Opening');