1
Fork 0
This commit is contained in:
ashley 2024-08-04 09:21:09 +00:00
parent 8dfaf532d8
commit a617d8e887

View file

@ -679,6 +679,8 @@ background-color: #0000;
audio.pause(); audio.pause();
}); });
video.on('seeking', handleSeek); video.on('seeking', handleSeek);
video.on('seeked', () => { video.on('seeked', () => {
@ -697,22 +699,9 @@ background-color: #0000;
audio.pause(); 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> </script>
<% if(dm) { %> <% if(dm) { %>