Skip to content

Commit

Permalink
Fix for jammed play/pause button
Browse files Browse the repository at this point in the history
See issue #12
  • Loading branch information
JohnyP36 committed Dec 5, 2022
1 parent 13abd3b commit 4e4df97
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions manifest_v2/js/autoplay+loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ let YTNonstop = function YTNonstop(options) {
};

//if paused ---> unpause
const Play = p => {
if(get_YT.player().getPlayerState() === 2) {
p.click();
get_YT.player().playVideo();
console.log('Clicked to unpause video');
}
};
// const Play = p => {
// if(get_YT.player().getPlayerState() === 2) {
// p.click();
// get_YT.player().playVideo();
// console.log('Clicked to unpause video');
// }
// };
function Run() {
const Play_Pause = {
getButton:window.document.getElementsByClassName("ytp-play-button ytp-button")[0] || window.document.getElementById("play-pause-button"),
Expand All @@ -128,8 +128,8 @@ let YTNonstop = function YTNonstop(options) {
//get "you there?" popup
const p = window.document.getElementById("confirm-button") || window.document.getElementsByClassName('ytmusic-you-there-renderer')[2] || undefined;
if(p) {
Play(p);
console.log('Popup gets closed and video will start playing again');
// Play(p);
// console.log('Popup gets closed and video will start playing again');
}
else {
AutoPlay();
Expand Down Expand Up @@ -255,4 +255,4 @@ window.onload = event => {
injectScript(YTNonstop,"html")
}
)
};
};

0 comments on commit 4e4df97

Please sign in to comment.