Skip to content

Play a finished motion-graphics ad in sync with the rough drafts it grew from, and export the breakdown as MP4.

feat: add frame-step keyboard shortcuts

Aaqibhafeez Khan9e308e7a6a92
diff --git a/README.md b/README.md
index 52e84e2..9a33ceb 100644
--- a/README.md
+++ b/README.md
@@ -125,6 +125,9 @@ The importer creates non-destructive segments, extracts thumbnails, and hard-lin
## FAQ and troubleshooting
+**How do I move through the film frame by frame?**
+Pause the film, then press `,` to step back one frame or `.` to step forward (1/30 second). Use `Home` to jump to the start and `End` to jump to the end. The left and right arrow keys still jump between sections.
+
**The Download button says "Needs Chrome or Edge".**
Export uses WebCodecs and `requestVideoFrameCallback`. Use a current Chrome or Edge. Firefox and Safari can play the preview but can't export.
diff --git a/public/demo.mjs b/public/demo.mjs
index 7868822..955c6af 100644
--- a/public/demo.mjs
+++ b/public/demo.mjs
@@ -168,6 +168,19 @@ document.addEventListener('keydown', event => {
const next = event.code === 'ArrowRight' ? Math.min(sections.length - 1, active + 1) : Math.max(0, active - 1);
video.currentTime = sections[next].start;
render();
+ return;
+ }
+ if (event.key === 'Home' || event.key === 'End') {
+ event.preventDefault();
+ video.currentTime = event.key === 'Home' ? 0 : duration;
+ render();
+ return;
+ }
+ if (video.paused && (event.key === ',' || event.key === '.')) {
+ event.preventDefault();
+ const step = 1 / 30;
+ video.currentTime = Math.min(duration, Math.max(0, video.currentTime + (event.key === ',' ? -step : step)));
+ render();
}
});
new ResizeObserver(layout).observe($('stage'));