Skip to content

Commit

Permalink
Update player.js cleanup listeners after option switch
Browse files Browse the repository at this point in the history
  • Loading branch information
raszpl authored Jun 15, 2024
1 parent f04d981 commit 34dbe04
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js&css/web-accessible/www.youtube.com/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -988,9 +988,7 @@ ImprovedTube.playerControls = function () {

if (player && player.hideControls && player.showControls) {

if (hide === 'always') {
player.hideControls();
} else if (hide === 'when_paused' && this.elements.video.paused) {
if (hide === 'when_paused' && this.elements.video.paused) {
player.hideControls();

player.onmouseenter = player.showControls;
Expand All @@ -1004,9 +1002,15 @@ ImprovedTube.playerControls = function () {
thread = setTimeout(player.hideControls, 1000);
};
})();
return;
} else if (hide === 'always') {
player.hideControls();
} else {
player.showControls();
}
player.onmouseenter = null;
player.onmouseleave = null;
player.onmousemove = null;
}
};
/*# HIDE VIDEO TITLE IN FULLSCREEN */ // Easier with CSS only (see player.css)
Expand Down

0 comments on commit 34dbe04

Please sign in to comment.