mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 20:52:06 +00:00
add apiLoaded event to disable-autoplay plugin
This commit is contained in:
@ -1,10 +1,7 @@
|
|||||||
const { ontimeupdate } = require("../../providers/video-element");
|
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
ontimeupdate((videoElement) => {
|
document.addEventListener('apiLoaded', e => {
|
||||||
if (videoElement.currentTime === 0 && videoElement.duration !== NaN) {
|
document.querySelector('video').addEventListener('loadeddata', e => {
|
||||||
// auto-confirm-when-paused plugin can interfere here if not disabled!
|
e.target.pause();
|
||||||
videoElement.pause();
|
})
|
||||||
}
|
})
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user