From f4e2d56b181fee4d693dea1dfe81974237e4eff7 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 3 Dec 2023 19:30:56 +0100 Subject: [PATCH] fix(YouTube - SponsorBlock): Prevent autoplay from stopping to work --- .../app/revanced/integrations/patches/VideoInformation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/app/revanced/integrations/patches/VideoInformation.java b/app/src/main/java/app/revanced/integrations/patches/VideoInformation.java index 2b9bea41..81ae8ce2 100644 --- a/app/src/main/java/app/revanced/integrations/patches/VideoInformation.java +++ b/app/src/main/java/app/revanced/integrations/patches/VideoInformation.java @@ -136,7 +136,7 @@ public final class VideoInformation { final long videoLength = getVideoLength(); // Prevent issues such as play/ pause button or autoplay not working. - final long seekToMilliseconds = millisecond > videoLength ? Integer.MAX_VALUE : millisecond; + final long seekToMilliseconds = Math.min(millisecond, VideoInformation.getVideoLength() - 250); ReVancedUtils.verifyOnMainThread(); try {