diff --git a/js&css/web-accessible/functions.js b/js&css/web-accessible/functions.js index 38e1d37cb..772b5e01b 100644 --- a/js&css/web-accessible/functions.js +++ b/js&css/web-accessible/functions.js @@ -432,7 +432,7 @@ ImprovedTube.playerOnEnded = function (event) { ImprovedTube.onkeydown = function () { window.addEventListener('keydown', function () { - if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing')) { + if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing') === false) { ImprovedTube.user_interacted = true; } }, true); @@ -440,7 +440,7 @@ ImprovedTube.onkeydown = function () { ImprovedTube.onmousedown = function (event) { window.addEventListener('mousedown', function (event) { - if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing')) { + if (ImprovedTube.elements.player && ImprovedTube.elements.player.classList.contains('ad-showing') === false) { var path = event.composedPath(); for (var i = 0, l = path.length; i < l; i++) { diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index e119e1a9e..c147260b2 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -681,10 +681,12 @@ ImprovedTube.playerScreenshotButton = function () { REPEAT -------------------------------------------------------------------------------*/ ImprovedTube.playerRepeat = function () { - setTimeout(function () { - ImprovedTube.elements.video.setAttribute('loop', ''); + setTimeout(function () { + if (!/ad-showing/.test(ImprovedTube.elements.player.className) { + ImprovedTube.elements.video.setAttribute('loop', ''); + } //ImprovedTube.elements.buttons['it-repeat-styles'].style.opacity = '1'; //old class from version 3.x? that both repeat buttons could have - }, 200); + }, 200); } /*------------------------------------------------------------------------------ REPEAT BUTTON @@ -1296,4 +1298,4 @@ ImprovedTube.miniPlayer = function () { window.removeEventListener('scroll', this.miniPlayer_scroll); window.removeEventListener('mousemove', this.miniPlayer_cursorUpdate); } -}; +}; \ No newline at end of file