diff --git a/src/components/CompareStudio.jsx b/src/components/CompareStudio.jsx
index e4883b6..9f62c49 100644
--- a/src/components/CompareStudio.jsx
+++ b/src/components/CompareStudio.jsx
@@ -44,6 +44,7 @@ export default function CompareStudio() {
const [isPlaying, setIsPlaying] = useState(false);
const [speed, setSpeed] = useState(1);
const [loop, setLoop] = useState(false);
+ const [skipIdle, setSkipIdle] = useState(false);
const [overlayEnabled, setOverlayEnabled] = useState(true);
const [playhead, setPlayhead] = useState(0);
const [duration, setDuration] = useState(0);
@@ -55,6 +56,7 @@ export default function CompareStudio() {
const V = useMemo(() => ({ ...brand, ...(dark ? darkSurface : lightSurface) }), [dark]);
const bothLoaded = leftFile && rightFile;
+ const both = useCallback((fn) => { fn(leftRef.current); fn(rightRef.current); }, []);
// Poll playhead from left player to keep shared display in sync
useEffect(() => {
@@ -72,9 +74,12 @@ export default function CompareStudio() {
return () => cancelAnimationFrame(pollRef.current);
}, [bothLoaded]);
- // Shared control helpers
- const both = (fn) => { fn(leftRef.current); fn(rightRef.current); };
+ useEffect(() => {
+ if (!bothLoaded) return;
+ both((r) => r?.setSkipIdle?.(skipIdle));
+ }, [both, bothLoaded, skipIdle]);
+ // Shared control helpers
const togglePlay = () => {
both((r) => r?.togglePlay?.());
};
@@ -93,6 +98,11 @@ export default function CompareStudio() {
setLoop(next);
both((r) => r?.setLoop?.(next));
};
+ const toggleSkipIdle = () => {
+ const next = !skipIdle;
+ setSkipIdle(next);
+ both((r) => r?.setSkipIdle?.(next));
+ };
const handleDrop = useCallback((side) => (e) => {
e.preventDefault();
@@ -330,6 +340,26 @@ export default function CompareStudio() {
>
⟲
+