mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-03 17:22:54 +01:00
fix(youtube/remember-video-quality): do not show 'auto' in video resolution picker if a default quality is set (#400)
This commit is contained in:
parent
feed762707
commit
e30d1201c9
@ -110,15 +110,25 @@ public class RememberVideoQualityPatch {
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the desired quality index is equal to the original index,
|
||||||
|
// then the video is already set to the desired default quality.
|
||||||
|
//
|
||||||
|
// The method could return here, but the UI video quality flyout will still
|
||||||
|
// show 'Auto' (ie: Auto (480p))
|
||||||
|
// It appears that "Auto" picks the resolution on video load,
|
||||||
|
// and it does not appear to change the resolution during playback.
|
||||||
|
//
|
||||||
|
// To prevent confusion, set the video index anyways (even if it matches the existing index)
|
||||||
|
// As that will force the UI picker to not display "Auto" which may confuse the user.
|
||||||
if (qualityIndexToUse == originalQualityIndex) {
|
if (qualityIndexToUse == originalQualityIndex) {
|
||||||
LogHelper.printDebug(() -> "Video is already preferred quality: " + preferredQuality);
|
LogHelper.printDebug(() -> "Video is already preferred quality: " + preferredQuality);
|
||||||
return originalQualityIndex;
|
} else {
|
||||||
|
final int qualityToUseLog = qualityToUse;
|
||||||
|
LogHelper.printDebug(() -> "Quality changed from: "
|
||||||
|
+ videoQualities.get(originalQualityIndex) + " to: " + qualityToUseLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
final int qualityToUseLog = qualityToUse;
|
|
||||||
LogHelper.printDebug(() -> "Quality changed from: "
|
|
||||||
+ videoQualities.get(originalQualityIndex) + " to: " + qualityToUseLog);
|
|
||||||
|
|
||||||
Method m = qInterface.getClass().getMethod(qIndexMethod, Integer.TYPE);
|
Method m = qInterface.getClass().getMethod(qIndexMethod, Integer.TYPE);
|
||||||
m.invoke(qInterface, qualityToUse);
|
m.invoke(qInterface, qualityToUse);
|
||||||
return qualityIndexToUse;
|
return qualityIndexToUse;
|
||||||
|
Loading…
Reference in New Issue
Block a user