Skip to content

Commit

Permalink
Update player.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube authored May 6, 2024
1 parent 1737326 commit e3fee6d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions js&css/web-accessible/www.youtube.com/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ if (ImprovedTube.storage.player_autoplay_disable
// if (no user clicks) and (no ads playing) and
// ( there is a video and ( (it is not in a playlist and auto play is off ) or ( playlist auto play is off and in a playlist ) ) ) or (if we are in a channel and the channel trailer autoplay is off) )

// user didnt click
// user didnt click
if (video && !this.user_interacted
// no ads playing
// no ads playing
&& !video.classList.contains('ad-showing')
// video
// video
&& ((location.href.includes('/watch?') // #1703
// player_autoplay_disable & not playlist
// player_autoplay_disable & not playlist
&& (ImprovedTube.storage.player_autoplay_disable && !location.href.includes('list='))
// !playlist_autoplay & playlist
// !playlist_autoplay & playlist
|| (ImprovedTube.storage.playlist_autoplay === false && location.href.includes('list=')))
// channel homepage & !channel_trailer_autoplay
// channel homepage & !channel_trailer_autoplay
|| (ImprovedTube.storage.channel_trailer_autoplay === false && ImprovedTube.regex.channel.test(location.href)))) {

if (!ImprovedTube.autoplayDeniedOnce) {
setTimeout(function () { video.pauseVideo(); });
ImprovedTube.autoplayDeniedOnce = true;
} else { video.pauseVideo();
console.log("autoplay:off - should we pause here again?");
}
}
}
}
};
Expand Down

0 comments on commit e3fee6d

Please sign in to comment.