mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 21:27:43 +02:00
fix(YouTube): When clicking on timestamps in comments, playback speed sometimes changes to 1.0x (unpatched YouTube bug)
This commit is contained in:
@ -0,0 +1,26 @@
|
||||
package app.revanced.extension.youtube.patches.utils;
|
||||
|
||||
import app.revanced.extension.shared.utils.Logger;
|
||||
import app.revanced.extension.youtube.shared.PlayerType;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class PlaybackSpeedWhilePlayingPatch {
|
||||
private static final float DEFAULT_YOUTUBE_PLAYBACK_SPEED = 1.0f;
|
||||
|
||||
public static boolean playbackSpeedChanged(float playbackSpeed) {
|
||||
if (playbackSpeed == DEFAULT_YOUTUBE_PLAYBACK_SPEED &&
|
||||
PlayerType.getCurrent().isMaximizedOrFullscreen()) {
|
||||
|
||||
Logger.printDebug(() -> "Even though playback has already started and the user has not changed the playback speed, " +
|
||||
"the app attempts to change the playback speed to 1.0x." +
|
||||
"\nIgnore changing playback speed, as it is invalid request.");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user