mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 02:57:49 +01:00
1
This commit is contained in:
parent
c7b01a6af3
commit
87eeac58a3
1 changed files with 7 additions and 0 deletions
|
@ -648,6 +648,12 @@ background-color: #0000;
|
||||||
// Pause video and audio when seeking
|
// Pause video and audio when seeking
|
||||||
video.pause();
|
video.pause();
|
||||||
audio.pause();
|
audio.pause();
|
||||||
|
|
||||||
|
// Sync audio with video during seeking
|
||||||
|
if (Math.abs(video.currentTime() - audio.currentTime) > 0.3) {
|
||||||
|
audio.currentTime = video.currentTime();
|
||||||
|
}
|
||||||
|
|
||||||
if (!checkAudioBuffer()) {
|
if (!checkAudioBuffer()) {
|
||||||
// Resume playback when buffering is sufficient
|
// Resume playback when buffering is sufficient
|
||||||
audio.addEventListener('canplay', () => {
|
audio.addEventListener('canplay', () => {
|
||||||
|
@ -658,6 +664,7 @@ background-color: #0000;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
video.on('play', () => {
|
video.on('play', () => {
|
||||||
audio.play();
|
audio.play();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue