make lite-youtube pausing also work when the button is clicked

pull/104/head
Aevann 2023-01-28 12:38:06 +02:00
parent 8b859cc610
commit 2006040375
1 changed files with 3 additions and 1 deletions

View File

@ -328,7 +328,9 @@ function prepare_to_pause(audio) {
}
document.addEventListener('click', (e) => {
if (e.target.tagName.toLowerCase() == "lite-youtube" && !audio.paused) audio.pause();
if ((e.target.tagName.toLowerCase() == "lite-youtube" || e.target.classList.contains('lty-playbtn')) && !audio.paused) {
audio.pause();
}
});
}