You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace timeupdate-based synchronization with requestVideoFrameCallback() (falling back to requestAnimationFrame() where unavailable) to achieve smoother frame-level synchronization between the comparison videos.
Problem this solves
The comparison view synchronizes the right video with the left using the timeupdate event.
Since this event is throttled by browsers and does not fire for every rendered frame, the right video can temporarily lag behind the left during playback, especially on high refresh rate displays or while seeking.
Proposed solution
Replace the timeupdate-based synchronization with requestVideoFrameCallback() to synchronize videos on every rendered frame,
Add a fallback to requestAnimationFrame() for browsers that do not support the API.
Benefits
Provides smoother, frame-accurate synchronization between the comparison videos.
Reduces visible playback drift on high refresh rate displays and during rapid seeking.
Avoids relying on the browser's throttled timeupdate event for synchronization.
Target File:
src/components/ComparisonPreview.tsxFeature description
timeupdate-based synchronization withrequestVideoFrameCallback()(falling back torequestAnimationFrame()where unavailable) to achieve smoother frame-level synchronization between the comparison videos.Problem this solves
timeupdateevent.Proposed solution
imeupdate-based synchronization withrequestVideoFrameCallback()to synchronize videos on every rendered frame,requestAnimationFrame()for browsers that do not support the API.Benefits
timeupdateevent for synchronization.Additional context