ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.47k stars 286 forks source link

bug(YouTube - Minimized playback): Shorts are getting the old buggy pip #214

Closed ILoveOpenSourceApplications closed 1 year ago

ILoveOpenSourceApplications commented 1 year ago

Bug description

If the user plays shorts right after watching a video and then minimizes the app, it'll end up creating the old shorts button abomination of a pip mode which was taken out of minimized playback due to this.

Screenshot_20231013-222433~2

Error logs

No response

Solution

No response

Additional context

No response

Acknowledgements

LisoUseInAIKyrios commented 1 year ago

Post a video showing the reproduction steps.

For me the app goes to background and no pip is shown (the expected and correct behavior).

LisoUseInAIKyrios commented 1 year ago

I think the issue might be the player type is 'sliding_minimized' when the app is exited, and the patch only checks for 'none' and 'hidden'. If this is true the fix is a 1 line change.

ILoveOpenSourceApplications commented 1 year ago

If shorts is played straight away, it works as normal. If it's played after playing a video then it fails.

Edit: Removed the video link.

LisoUseInAIKyrios commented 1 year ago

"This video isn’t ready Ask the video creator to sign up and share this with you again to preview."

I think videos can be posted here to GitHub. Or try a different video sharing site.

ILoveOpenSourceApplications commented 1 year ago

Can you recommend one? I think my previously uploaded video got corrupted. I tried uploading here but I think the size is too much for GitHub.

Edit: Nvm, It's broken again.

LisoUseInAIKyrios commented 1 year ago

Still getting the same error message for the video.

ILoveOpenSourceApplications commented 1 year ago

https://youtube.com/shorts/afU_symkIjM?feature=shared

LisoUseInAIKyrios commented 1 year ago

Yes, it needed to check for sliding minimized.

It should be fixed with https://github.com/ReVanced/revanced-integrations/commit/7d02774ea192510e692e90ae55a86e25ee321926

ILoveOpenSourceApplications commented 1 year ago

@LisoUseInAIKyrios, I don't know how to access early integration and hence used RVX which I believe has already merged your commit (I'm not sure, you can correct me if I'm wrong). So I repeated the above steps, when playing a video and the shorts right below it, the buggy pip isn't there anymore. But if I'm playing a video and the shorts from home or searching and playing a video and the shorts from the search and minimizing, the buggy pip is still there.

LisoUseInAIKyrios commented 1 year ago

@ILoveOpenSourceApplications you can patch the dev release with CLI tools and a computer or on device using Termux console.

Post another video showing the issue. I don't quite follow the reproduction steps listed.

ILoveOpenSourceApplications commented 1 year ago

https://github.com/ReVanced/revanced-patches/assets/117499019/ba128952-0758-41de-814d-08437ac6adaf

See how if I play the shorts below the video, it's fixed and working fine. But if I go back to the search page and play a short and then minimize it, the buggy pip is back. The same goes for if in home page.

LisoUseInAIKyrios commented 1 year ago

I am unable to reproduce using ReVanced dev release. Install the latest ReVanced dev release, if it still acts up post a video using it.

ILoveOpenSourceApplications commented 1 year ago

@ILoveOpenSourceApplications you can patch the dev release with CLI tools and a computer.

I decided to use CLI. Is it recommended to use the specified version 11 or is that the only supported JDK version?

LisoUseInAIKyrios commented 1 year ago

11 or newer should work. If you are not doing development then you don't need the JDK and the regular JRE will work (it may be already be installed on your system).

ILoveOpenSourceApplications commented 1 year ago

I downloaded the latest CLI v4.0.2 but it's not opening. I have the latest JDK version.

LisoUseInAIKyrios commented 1 year ago

Need more details. Post the console command you used to run CLI and post what happened when you ran that.

ILoveOpenSourceApplications commented 1 year ago

Can you provide the steps on how to use CLI (for a noob)?

LisoUseInAIKyrios commented 1 year ago

https://sodawithoutsparkles.github.io/revanced-troubleshooting-guide/06-revanced-cli/

ILoveOpenSourceApplications commented 1 year ago

Which ReVanced Patches version should I download?

ILoveOpenSourceApplications commented 1 year ago

https://github.com/ReVanced/revanced-patches/assets/117499019/e88aabe9-051a-4a07-a6eb-b7f510e7f82a

For compressions sake and uploading it here, I have sped up the video. Watch it in 0.5x and it should look normal. I used integrations v0.120.0-dev.5, patches v2.195.0-dev.3, cli v4.0.2 & YouTube v18.38.44.

LisoUseInAIKyrios commented 1 year ago

I still cannot tell exactly what are the steps to reproduce, and I still cannot reproduce the issue on my end.

The patch needs additional logging to tell what is going on, and after that is added you'll need to use adb to collect the logs so it's more clear what state the app is in.

Or just live with it the way it is now. It's obscure and not a typical use case to minimize the app immediately after rapidly navigating and closing/opening different videos as shown in the reproduction video.

ILoveOpenSourceApplications commented 1 year ago

The reproduction steps are very simple. Step 1: Play a video in home or from the search(MKBHD in my case). Step 2: Either pause or minimize the video playing. Don't close the video playing. Step 3: Play a short in home screen or from the search. (Let the shorts start playing) Step 4: Minimize the app while the shorts is playing. Buggy shorts pip appears.

But after your commit 7d02774 , this issue which was also present after playing the shorts below a video player is no longer reproducible.

ILoveOpenSourceApplications commented 1 year ago

Or just live with it the way it is now. It's obscure and not a typical use case to minimize the app immediately after rapidly navigating and closing/opening different videos as shown in the reproduction video.

I did it at a fast pace to keep the video length down and hence the size as well. But the issue exist despite the quick playing and minimizing of the app.

LisoUseInAIKyrios commented 1 year ago

I was finally able to reproduce. Had to leave the video playing on step 2, and minimize the short immediately after opening.

ILoveOpenSourceApplications commented 1 year ago

Sometimes immediately and sometimes it'll happen slowly as well. Glad that you could reproduce it on your side as well.

ILoveOpenSourceApplications commented 1 year ago

But it's not completely fixed @oSumAtrIX.

oSumAtrIX commented 1 year ago

Please open a new issue