mirror of
https://codeberg.org/ashley/poke
synced 2025-05-28 18:19:43 +00:00
Update css/player-base.js
This commit is contained in:
parent
a3b44a58ee
commit
43b8b641a7
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user