revanced-patches icon indicating copy to clipboard operation
revanced-patches copied to clipboard

feat(YouTube): Remove sleep timer menu restrictions

Open zainarbani opened this issue 1 year ago • 5 comments

Screenshots

image1

image2

TODO

  • [ ] Finish and merge https://github.com/ReVanced/revanced-patches/pull/3629
  • [ ] Add options to hide this menu

zainarbani avatar Sep 13 '24 09:09 zainarbani

If you press Close, will YouTube close, and will you no longer be able to open it?

cyberboh avatar Sep 13 '24 10:09 cyberboh

If you press Close, will YouTube close, and will you no longer be able to open it?

If the user still 'awake' then press close to continue watching, or simply ignore it (sleep) then screen will go off by itself.

zainarbani avatar Sep 13 '24 10:09 zainarbani

@LisoUseInAIKyrios the tittle shouldn't changed, it's to unlock the timer, not to remove it, imo

cyberboh avatar Sep 14 '24 05:09 cyberboh

The PR title is the same as the patch name, and its similar to the Remove background playback restrictions.

This PR removes all restrictions for using the sleep timer, including the a/b account selection restriction since sleep timer is an experimental feature.

LisoUseInAIKyrios avatar Sep 14 '24 07:09 LisoUseInAIKyrios

This could use a new hide fly out setting, to hide the feature if the user doesn't want it.

Looks like the buffer string yt_outline_moon_z_ works

LisoUseInAIKyrios avatar Sep 14 '24 07:09 LisoUseInAIKyrios

@zainarbani For me, the sleep timer appears in two places in the flyout menu. Without this PR I already have it in the root flyout menu, and with this patch it shows a second time in the additional settings menu.

There must be two different feature flags. Ideally this would set one flag as true and the other as false to prevent duplicates.

LisoUseInAIKyrios avatar Oct 19 '24 13:10 LisoUseInAIKyrios

I just realized that this features was now enabled by default on stock 19.34.42, 19.41.39, also on non premium (tested with 2 account). Can you reproduce this? If this applied to all user then we don't need this patches i think.

zainarbani avatar Oct 19 '24 15:10 zainarbani

In ReVanced when I switch to a non premium account after using my premium account, the sleep timer is present for non premium.

But when I use the same account with un-patched YouTube the sleep timer is not present. Maybe it hasn't rolled out to my stock YouTube because I almost never open it.

So maybe this isn't needed anymore. The hide fly out function can be kept, so can remove the feature flag patch and still use this PR.

LisoUseInAIKyrios avatar Oct 19 '24 16:10 LisoUseInAIKyrios

But I don't have this menu item either on the root page or in the flyout menu, I've never had a premium account, so it seems to me that this PR is still needed. 19.34, 19.39, 19.40 and 19.42 tested. Original YouTube app is frozen from beginning and i opened it only to generate PoToken when new GmsCore was introduced.

Screenshot_2024-10-19-19-47-52-672_app.revanced.android.youtube.jpg

Screenshot_2024-10-19-20-01-52-218_app.revanced.android.youtube.jpg

Screenshot_2024-10-19-19-47-34-370_app.revanced.android.youtube.jpg

MarcaDian avatar Oct 19 '24 16:10 MarcaDian

@LisoUseInAIKyrios @MarcaDian I think duplicated menu is fixed now, can you confirm on your end?

zainarbani avatar Oct 19 '24 17:10 zainarbani

https://9to5google.com/2024/10/15/youtube-new-miniplayer/

zainarbani avatar Oct 19 '24 18:10 zainarbani

@zainarbani The duplicate flyout menu is fixed for me.

The sleep timer does not appear to be a Premium exclusive feature, and it seems to be rolling out to all users. It's useful to enable the feature now, but a dedicated patch may soon be obsolete.

Maybe the feature flag change can be rolled into Player flyout menu patch. That would give the functionality and no need to later deprecate or remove a stand alone patch.

LisoUseInAIKyrios avatar Oct 20 '24 06:10 LisoUseInAIKyrios

I tested the last commit, but now I don't have this sleep timer menu anywhere, neither in the root flyout menu nor in the video flyout menu. I guess I haven't received the flag yet. 🤷

MarcaDian avatar Oct 20 '24 16:10 MarcaDian

Or maybe there's two feature flags for different menu locations. Because the sleep timer works for me without this PR.

LisoUseInAIKyrios avatar Oct 20 '24 16:10 LisoUseInAIKyrios

https://9to5google.com/2024/10/15/youtube-new-miniplayer/

I get this new sleep timer as default on revanced yt 19.34.42. Spoof streams turned off tho, and i'm not premium user.

cyberboh avatar Oct 20 '24 23:10 cyberboh

@MarcaDian Try clearing stock app data. Sometimes sleep timer menu are delayed or not showing on the root flyout menu (probably still calculating the video lengths), you need to re-open flyout menu.

zainarbani avatar Oct 21 '24 05:10 zainarbani

Off topic but it seems modern miniplayer & new cairo setting layout are now enabled by default on stock app.

zainarbani avatar Oct 21 '24 05:10 zainarbani

Now I got the flag too. New Cairo boot animation, cairo seekbar, modern miniplayer and Sleep Timer item has appeared without this PR.

MarcaDian avatar Oct 23 '24 07:10 MarcaDian

I assume its pretty safe to remove the feature flag patch now

zainarbani avatar Oct 23 '24 08:10 zainarbani

@oSumAtrIX @LisoUseInAIKyrios btw, is there a plan to enable the new cairo settings layout? just in case the old layout removed by youtube.

zainarbani avatar Oct 23 '24 08:10 zainarbani

Eventually, yeah. Allowing the Cairo settings breaks some patches (such as seekbar color, background playback), so it's more than just fixing the settings menu.

LisoUseInAIKyrios avatar Oct 23 '24 08:10 LisoUseInAIKyrios

Just a question, is it possible to make Cairo seekbar always in color? because usually it is gray when not clicked on the player.

Screenshot_2024-10-25-20-37-20-324-edit_app.revanced.android.youtube.jpg

Screenshot_2024-10-25-20-37-07-841-edit_app.revanced.android.youtube.jpg

We can also add Theme patch option to change Cairo seekbar color. https://github.com/anddea/revanced-patches/commit/b956855183f3f6c85a41e0d3812da6ff71ec8157

MarcaDian avatar Oct 25 '24 17:10 MarcaDian

If you turn on custom seekbar color, then the seekbar is always that color and not white when in dark mode. But with custom color it's no longer Cairo gradient style.

The downside to that patch is it's a patch time change and not runtime. The Cairo gradient color is now hooked in the code, and instead of overriding both start and end with the same custom color it could be possible to pick two colors in the setting.

Edit: using two custom colors might look out of place since it would be a mix of single color and gradient in different places. Some places it draws a single color (such as dark mode where it's white), and the feature flag to disable the broken Cairo settings also changes the seekbar to solid color in a few places.

Edit 2: Even with the Cairo settings enabled, the seekbar is not gradient everywhere. Allowing custom gradients may not be very useful, especially since the custom gradients chosen must visually make sense otherwise the gradient looks like a mess.

LisoUseInAIKyrios avatar Oct 25 '24 17:10 LisoUseInAIKyrios