Skip to content

Commit 928a22a

Browse files
committed
fix: tighten dual-video frame synchronization
1 parent f1d4339 commit 928a22a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

examples/kern-calibration/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ An original cinematic example website for the `cinematic-scroll` skill.
88
- A continuously playing monochrome base video.
99
- A synchronized full-colour video above it.
1010
- Scroll-scrubbed CSS `clip-path` masking applied only to the colour layer.
11-
- Frame-by-frame drift correction using `requestVideoFrameCallback`, with playback-rate convergence and an 80 ms hard-resync threshold.
11+
- Frame-by-frame drift correction using `requestVideoFrameCallback`, with playback-rate convergence and a 45 ms hard-resync threshold.
1212
- Generated precision-mechanical hero imagery converted into a seamless 12-second, 30 fps master loop.
1313
- Five selectable mechanical systems with live readings and macro crops.
1414
- Procedural Web Audio ambience behind an explicit user-controlled sound toggle.

examples/kern-calibration/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@
9898
function syncVideos(force=false){
9999
if(!monoVideo.duration||!colorVideo.duration)return;
100100
const delta=monoVideo.currentTime-colorVideo.currentTime, drift=Math.abs(delta);
101-
if(force||drift>.08){colorVideo.currentTime=monoVideo.currentTime;colorVideo.playbackRate=1;}
102-
else colorVideo.playbackRate=1+Math.max(-.06,Math.min(.06,delta*.8));
101+
if(force||drift>.045){colorVideo.currentTime=monoVideo.currentTime;colorVideo.playbackRate=1;}
102+
else colorVideo.playbackRate=1+Math.max(-.08,Math.min(.08,delta));
103103
if(monoVideo.paused!==colorVideo.paused){monoVideo.paused?colorVideo.pause():colorVideo.play().catch(()=>{});}
104104
}
105105
async function startVideos(){

0 commit comments

Comments
 (0)