Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(YouTube - Player flyout menu): Hide sleep timer #3637

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

zainarbani
Copy link
Contributor

@zainarbani zainarbani commented Sep 13, 2024

Sleep timer is a new feature rolling out to all YouTube users.

image1

image2

@cyberboh
Copy link

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

@zainarbani
Copy link
Contributor Author

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.

@LisoUseInAIKyrios LisoUseInAIKyrios changed the title feat(YouTube): Unlock sleep timer menu feat(YouTube): Remove sleep timer menu restrictions Sep 13, 2024
@cyberboh
Copy link

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

@LisoUseInAIKyrios
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

LisoUseInAIKyrios commented Oct 19, 2024

@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.

@zainarbani
Copy link
Contributor Author

zainarbani commented Oct 19, 2024

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.

@LisoUseInAIKyrios
Copy link
Contributor

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.

@MarcaDian
Copy link
Contributor

MarcaDian commented Oct 19, 2024

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

@zainarbani
Copy link
Contributor Author

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

@zainarbani
Copy link
Contributor Author

@LisoUseInAIKyrios
Copy link
Contributor

@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.

@MarcaDian
Copy link
Contributor

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. 🤷

@LisoUseInAIKyrios
Copy link
Contributor

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

@cyberboh
Copy link

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.

@zainarbani
Copy link
Contributor Author

zainarbani commented Oct 21, 2024

@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
Copy link
Contributor Author

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

@MarcaDian
Copy link
Contributor

MarcaDian commented Oct 23, 2024

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

@zainarbani
Copy link
Contributor Author

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

@zainarbani
Copy link
Contributor Author

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

@LisoUseInAIKyrios
Copy link
Contributor

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.

@MarcaDian
Copy link
Contributor

MarcaDian commented Oct 25, 2024

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.
anddea/revanced-patches@b956855

@LisoUseInAIKyrios
Copy link
Contributor

LisoUseInAIKyrios commented Oct 25, 2024

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 LisoUseInAIKyrios changed the title feat(YouTube): Remove sleep timer menu restrictions feat(YouTube - Player flyout menu): Hide sleep timer Oct 26, 2024
@LisoUseInAIKyrios LisoUseInAIKyrios merged commit 7436031 into ReVanced:dev Oct 26, 2024
1 check passed
@zainarbani zainarbani deleted the feat/yt-sleep-timer branch October 27, 2024 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants