mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 16:38:17 +01:00
gwa gwa
This commit is contained in:
parent
8dfaf532d8
commit
a617d8e887
1 changed files with 78 additions and 89 deletions
|
@ -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,21 +699,8 @@ 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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue