Skip to content

Commit e579c56

Browse files
author
LisoUseInAIKyrios
committed
fix(YouTube - Video quality): Show FHD+ icon for 1080p 60fps enhanced bitrate
1 parent 83f2390 commit e579c56

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/VideoInformation.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ public interface VideoQualityMenuInterface {
4141
public static final int AUTOMATIC_VIDEO_QUALITY_VALUE = -2;
4242

4343
/**
44-
* All quality names are the same for all languages.
45-
* VideoQuality also has a resolution enum that can be used if needed.
44+
* Video quality names are the same text for all languages.
45+
* Premium can be "1080p Premium" or "1080p60 Premium"
4646
*/
47-
public static final String VIDEO_QUALITY_1080P_PREMIUM_NAME = "1080p Premium";
48-
47+
public static final String VIDEO_QUALITY_PREMIUM_NAME = "Premium";
4948

5049
private static final float DEFAULT_YOUTUBE_PLAYBACK_SPEED = 1.0f;
5150
/**
@@ -407,14 +406,13 @@ public static long getVideoTime() {
407406
}
408407

409408
/**
410-
* @return If the playback is at the end of the video.
411-
* <p>
412409
* If video is playing in the background with no video visible,
413410
* this always returns false (even if the video is actually at the end).
414411
* <p>
415412
* This is equivalent to checking for {@link VideoState#ENDED},
416413
* but can give a more up-to-date result for code calling from some hooks.
417414
*
415+
* @return If the playback is at the end of the video.
418416
* @see VideoState
419417
*/
420418
@SuppressWarnings("BooleanMethodIsAlwaysInverted")

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/Filter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public enum FilterContentType {
4040
/**
4141
* Adds callbacks to {@link #isFiltered(String, String, byte[], StringFilterGroup, FilterContentType, int)}
4242
* if any of the groups are found.
43-
* <p>
4443
*/
4544
protected final void addIdentifierCallbacks(StringFilterGroup... groups) {
4645
identifierCallbacks.addAll(Arrays.asList(groups));
@@ -58,7 +57,6 @@ protected final void addPathCallbacks(StringFilterGroup... groups) {
5857
* Called after an enabled filter has been matched.
5958
* Default implementation is to always filter the matched component and log the action.
6059
* Subclasses can perform additional or different checks if needed.
61-
*
6260
* <p>
6361
* Method is called off the main thread.
6462
*

extensions/youtube/src/main/java/app/revanced/extension/youtube/videoplayer/VideoQualityDialogButton.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import static app.revanced.extension.shared.StringRef.str;
44
import static app.revanced.extension.shared.Utils.dipToPixels;
55
import static app.revanced.extension.youtube.patches.VideoInformation.AUTOMATIC_VIDEO_QUALITY_VALUE;
6-
import static app.revanced.extension.youtube.patches.VideoInformation.VIDEO_QUALITY_1080P_PREMIUM_NAME;
6+
import static app.revanced.extension.youtube.patches.VideoInformation.VIDEO_QUALITY_PREMIUM_NAME;
77

88
import android.app.Dialog;
99
import android.content.Context;
@@ -157,9 +157,9 @@ public static void updateButtonText(@Nullable VideoQuality quality) {
157157
case 2160 -> "4K";
158158
default -> "?"; // Should never happen.
159159
};
160-
161160
text.append(qualityText);
162-
if (resolution == 1080 && VIDEO_QUALITY_1080P_PREMIUM_NAME.equals(quality.patch_getQualityName())) {
161+
162+
if (quality != null && quality.patch_getQualityName().contains(VIDEO_QUALITY_PREMIUM_NAME)) {
163163
// Underline the entire "FHD" text for 1080p Premium.
164164
text.setSpan(new UnderlineSpan(), 0, qualityText.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
165165
}

0 commit comments

Comments
 (0)