Adjust video sync timing calculation for improved accuracy

This commit is contained in:
srgooglo 2025-06-24 20:02:09 +02:00
parent e90ecf27ac
commit 0f62d673f2

View File

@ -42,9 +42,13 @@ const LyricsVideo = React.forwardRef((props, videoRef) => {
const currentTrackTime = window.app.cores.player.controls.seek()
setSyncingVideo(true)
let newTime =
currentTrackTime + lyrics.video_starts_at_ms / 1000 + 150 / 1000
newTime -= 5 / 1000
let newTime = currentTrackTime + lyrics.video_starts_at_ms / 1000
// dec some ms to ensure the video seeks correctly
newTime -= 10 / 1000
// sum the audio gradual time fade
newTime = newTime + 150 / 1000
videoRef.current.currentTime = newTime
}, [lyrics, videoRef, setSyncingVideo])