Skip to content

Commit

Permalink
fix(YouTube - SponsorBlock): Allow autoplay when skipping to the end …
Browse files Browse the repository at this point in the history
…of the video
  • Loading branch information
oSumAtrIX committed Dec 2, 2023
1 parent dd045ad commit 3d660e1
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -135,10 +135,8 @@ public static void setVideoTime(final long currentPlaybackTime) {
public static boolean seekTo(final long millisecond) {
final long videoLength = getVideoLength();

// Don't seek more than the video length to prevent issues such as
// Play pause button or autoplay not working.
// TODO: These are arbitrarily chosen values and should be subject to be adjusted.
final long seekToMilliseconds = millisecond <= videoLength - 500 ? millisecond : millisecond - 100;
// Prevent issues such as play/ pause button or autoplay not working.
final long seekToMilliseconds = millisecond > videoLength ? Integer.MAX_VALUE : millisecond;

ReVancedUtils.verifyOnMainThread();
try {
Expand Down

0 comments on commit 3d660e1

Please sign in to comment.