mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-15 06:48:43 +01:00
test 1
This commit is contained in:
parent
00a7738a1d
commit
adc02ed151
1 changed files with 93 additions and 93 deletions
|
@ -7,7 +7,6 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
|
||||||
const qua = new URLSearchParams(window.location.search).get("quality") || "";
|
const qua = new URLSearchParams(window.location.search).get("quality") || "";
|
||||||
localStorage.setItem(`progress-${new URLSearchParams(window.location.search).get('v')}`, 0);
|
localStorage.setItem(`progress-${new URLSearchParams(window.location.search).get('v')}`, 0);
|
||||||
|
|
||||||
if (qua !== "medium") {
|
if (qua !== "medium") {
|
||||||
const audio = document.getElementById('aud');
|
const audio = document.getElementById('aud');
|
||||||
|
|
||||||
|
@ -48,9 +47,14 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
video.play();
|
video.play();
|
||||||
audio.play();
|
audio.play();
|
||||||
}
|
}
|
||||||
}, {
|
}, { once: true });
|
||||||
once: true
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
|
const playBothIfBuffered = () => {
|
||||||
|
if (isVideoBuffered() && checkAudioBuffer()) {
|
||||||
|
video.play();
|
||||||
|
audio.play();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -74,22 +78,17 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
video.on('waiting', () => {
|
video.on('waiting', () => {
|
||||||
video.pause();
|
video.pause();
|
||||||
audio.pause();
|
audio.pause();
|
||||||
|
|
||||||
|
// Add event listener to resume when buffering is done
|
||||||
|
video.on('canplaythrough', playBothIfBuffered);
|
||||||
});
|
});
|
||||||
|
|
||||||
video.on('canplaythrough', () => {
|
video.on('canplaythrough', playBothIfBuffered);
|
||||||
if (!video.paused()) {
|
|
||||||
video.play();
|
|
||||||
audio.play();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
video.on('seeking', handleSeek);
|
video.on('seeking', handleSeek);
|
||||||
|
|
||||||
video.on('seeked', () => {
|
video.on('seeked', () => {
|
||||||
if (isVideoBuffered()) {
|
playBothIfBuffered();
|
||||||
video.play();
|
|
||||||
}
|
|
||||||
audio.play(); // Ensure audio is playing after seek
|
|
||||||
});
|
});
|
||||||
|
|
||||||
video.on('volumechange', syncVolume);
|
video.on('volumechange', syncVolume);
|
||||||
|
@ -105,6 +104,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
video.pause();
|
video.pause();
|
||||||
audio.pause();
|
audio.pause();
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener('fullscreenchange', () => {
|
document.addEventListener('fullscreenchange', () => {
|
||||||
if (!document.fullscreenElement) {
|
if (!document.fullscreenElement) {
|
||||||
video.pause();
|
video.pause();
|
||||||
|
@ -112,7 +112,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
window.pokePlayer = {
|
window.pokePlayer = {
|
||||||
ver:`16-vjs-${videojs.VERSION}`,
|
ver:`16-vjs-${videojs.VERSION}`,
|
||||||
|
|
Loading…
Reference in a new issue