Skip to content

Commit 25470ba

Browse files
author
LisoUseInAIKyrios
committed
fix(YouTube - SponsorBlock): Do not hide voting or create button when the video ends
This logic is no longer needed, since YouTube no longer hides the overlay buttons when the video ends
1 parent b86da73 commit 25470ba

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

extensions/youtube/src/main/java/app/revanced/extension/youtube/sponsorblock/ui/SponsorBlockViewController.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import app.revanced.extension.shared.Logger;
1818
import app.revanced.extension.shared.Utils;
19-
import app.revanced.extension.youtube.settings.Settings;
2019
import app.revanced.extension.youtube.shared.PlayerType;
2120
import app.revanced.extension.youtube.sponsorblock.objects.SponsorSegment;
2221
import kotlin.Unit;
@@ -227,22 +226,4 @@ private static void setLayoutMargins(@NonNull View view, boolean fullScreen,
227226
params.bottomMargin = fullScreen ? ctaBottomMargin : defaultBottomMargin;
228227
view.setLayoutParams(params);
229228
}
230-
231-
/**
232-
* Injection point.
233-
*/
234-
public static void endOfVideoReached() {
235-
try {
236-
Logger.printDebug(() -> "endOfVideoReached");
237-
// the buttons automatically set themselves to visible when appropriate,
238-
// but if buttons are showing when the end of the video is reached then they need
239-
// to be forcefully hidden
240-
if (!Settings.AUTO_REPEAT.get()) {
241-
CreateSegmentButton.hideControls();
242-
VotingButton.hideControls();
243-
}
244-
} catch (Exception ex) {
245-
Logger.printException(() -> "endOfVideoReached failure", ex);
246-
}
247-
}
248229
}

patches/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockPatch.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ val sponsorBlockPatch = bytecodePatch(
202202
"""
203203
invoke-static { v$register }, $EXTENSION_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->appendTimeWithoutSegments(Ljava/lang/String;)Ljava/lang/String;
204204
move-result-object v$register
205-
""",
205+
"""
206206
)
207207
}
208208

@@ -252,15 +252,5 @@ val sponsorBlockPatch = bytecodePatch(
252252
}
253253
} ?: throw PatchException("Could not find the method which contains the replaceMeWith* strings")
254254
}
255-
256-
// The vote and create segment buttons automatically change their visibility when appropriate,
257-
// but if buttons are showing when the end of the video is reached then they will not automatically hide.
258-
// Add a hook to forcefully hide when the end of the video is reached.
259-
autoRepeatFingerprint.match(autoRepeatParentFingerprint.originalClassDef).method.addInstruction(
260-
0,
261-
"invoke-static {}, $EXTENSION_SPONSORBLOCK_VIEW_CONTROLLER_CLASS_DESCRIPTOR->endOfVideoReached()V",
262-
)
263-
264-
// TODO: Channel whitelisting.
265255
}
266256
}

0 commit comments

Comments
 (0)