Update css/player-base.js

This commit is contained in:
ashley 2025-05-27 17:09:02 +02:00
parent a3b44a58ee
commit 43b8b641a7

View File

@ -1,7 +1,6 @@
// in the beginning.... god made mrrprpmnaynayaynaynayanyuwuuuwmauwnwanwaumawp :p
var _yt_player = videojs;
document.addEventListener("DOMContentLoaded", () => {
document.addEventListener("DOMContentLoaded", () => {
// video.js 8 init - source can be seen in https://poketube.fun/static/vjs.min.js or the vjs.min.js file
const video = videojs('video', {
controls: true,
@ -174,6 +173,18 @@ var _yt_player = videojs;
clearSyncLoop();
});
// pause audio when video is buffering :3
video.on('waiting', () => {
audio.pause();
clearSyncLoop();
});
// resume audio when video resumes
video.on('playing', () => {
if (audioReady) audio.play();
if (!syncInterval) startSyncLoop();
});
// pauses and syncs on seek
video.on('seeking', () => {
audio.pause();