mirror of
https://codeberg.org/ashley/poke
synced 2025-05-30 02:59: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
|
// in the beginning.... god made mrrprpmnaynayaynaynayanyuwuuuwmauwnwanwaumawp :p
|
||||||
var _yt_player = videojs;
|
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
|
// 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', {
|
const video = videojs('video', {
|
||||||
controls: true,
|
controls: true,
|
||||||
@ -174,6 +173,18 @@ var _yt_player = videojs;
|
|||||||
clearSyncLoop();
|
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
|
// pauses and syncs on seek
|
||||||
video.on('seeking', () => {
|
video.on('seeking', () => {
|
||||||
audio.pause();
|
audio.pause();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user