mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +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 = () => {
|
||||
ontimeupdate((videoElement) => {
|
||||
if (videoElement.currentTime === 0 && videoElement.duration !== NaN) {
|
||||
// auto-confirm-when-paused plugin can interfere here if not disabled!
|
||||
videoElement.pause();
|
||||
}
|
||||
});
|
||||
document.addEventListener('apiLoaded', e => {
|
||||
document.querySelector('video').addEventListener('loadeddata', e => {
|
||||
e.target.pause();
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user