1
Fork 0

fix stuff :3

This commit is contained in:
ashley 2024-08-04 08:23:18 +00:00
parent adbf2784fc
commit 8dfaf532d8

View file

@ -679,8 +679,6 @@ background-color: #0000;
audio.pause();
});
video.on('seeking', handleSeek);
video.on('seeked', () => {
@ -699,8 +697,21 @@ background-color: #0000;
audio.pause();
}
});
// Initial synchronization
const syncAtStart = () => {
if (video.readyState() >= 3 && audio.readyState >= 3) { // Check if both video and audio are ready
audio.currentTime = video.currentTime();
video.play();
audio.play();
}
});
};
video.on('canplay', syncAtStart);
audio.addEventListener('canplay', syncAtStart);
}
});
</script>