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): Add Open Shorts in regular player patch #4153

Conversation

LisoUseInAIKyrios
Copy link
Contributor

@LisoUseInAIKyrios LisoUseInAIKyrios commented Dec 17, 2024

Adds an option to open Shorts in the regular video player.

If patching 19.46+, then can also open Shorts fullscreen in the regular player .

 

Shorts regular player

Player

Shorts regular player fullscreen

portrait
portrait controls

 
Code adapted from @0xrxL

@LisoUseInAIKyrios LisoUseInAIKyrios linked an issue Dec 17, 2024 that may be closed by this pull request
3 tasks
@LisoUseInAIKyrios
Copy link
Contributor Author

@0xrxL what video resolution are Shorts opening in for you? I'm seeing that every Short opens in the regular player in 360p, and after closing and reopening it's in 720p or 1080p.

I'm using default 'high quality' YouTube video quality and no ReVanced video override.

@LisoUseInAIKyrios
Copy link
Contributor Author

LisoUseInAIKyrios commented Dec 17, 2024

The low qualify seems to be caused by spoofing.

With spoofing on the quality starts at 360p/480p and after ~10 seconds it changes to 720p/1080p. With spoofing off the quality is correct on video start.

Edit: This issue affects all videos but I never noticed until now. With regular videos it's not as noticeable when a video starts in 480p, but with a portrait video it's much more pronounced.

@0xrxL
Copy link

0xrxL commented Dec 17, 2024

@LisoUseInAIKyrios You can make a further choice about this patch: if you still want to use shorts player, once you click the dedicated button on navigation bar, you can add a check to determine which button is pressed. The fingerprint should be already on this repo.

@0xrxL
Copy link

0xrxL commented Dec 17, 2024

The low qualify seems to be caused by spoofing.

With spoofing on the quality starts at 360p/480p and after ~10 seconds it changes to 720p/1080p. With spoofing off the quality is correct on video start.

Edit: This issue affects all videos but I never noticed until now. With regular videos it's not as noticeable when a video starts in 480p, but with a portrait video it's much more pronounced.

I cannot reproduce this issue on my side. I watched a shorts with video player, and after some seconds the higher resolution has been set as usual. 🤷‍♂️

Maybe the problem is iOS spoofing? I totally removed it from list.

@LisoUseInAIKyrios
Copy link
Contributor Author

I'm seeing low resolution only during the first 10 seconds, and only for Shorts that have never been opened before. Affects both spoof clients. Reopening a previous Short does not have the issue.

For me the issue is present for all videos (regular videos included), but visually it's only noticable with portrait shorts since the video is physically much larger on screen.

I didn't think about the Shorts nav tab. That should still always use the regular Shorts player.

@0xrxL
Copy link

0xrxL commented Dec 17, 2024

I didn't think about the Shorts nav tab. That should still always use the regular Shorts player.

In this case you need to add the aforementioned check. 👍

@LisoUseInAIKyrios LisoUseInAIKyrios changed the title feat(YouTube): Add Open Shorts in player patch feat(YouTube): Add Shorts player type patch Dec 17, 2024
@LisoUseInAIKyrios LisoUseInAIKyrios force-pushed the feat/open_shorts_in_regular_player branch from 01d275d to 7fef2aa Compare December 17, 2024 19:03
@LisoUseInAIKyrios
Copy link
Contributor Author

LisoUseInAIKyrios commented Dec 17, 2024

The low quality for the first 10 seconds might be fixed by figuring out how to not block the get_watch request.

Work in progress was here and here and discussion about the unsolved problems with not blocking here.

The 10 second quality issue does not show up with the regular Shorts player, and there is a delay when opening Shorts which may be the full video stream loading. Maybe can force that same Shorts preloading behavior for the regular player.

@0xrxL
Copy link

0xrxL commented Dec 18, 2024

@LisoUseInAIKyrios Last fix is done!

Screen_Recording_20241218_052727.mp4

@LisoUseInAIKyrios
Copy link
Contributor Author

Not sure what to call this patch.

Shorts player type (Too generic sounding?)
Change Shorts player type
Open Shorts in regular player (too wordy?)

@0xrxL
Copy link

0xrxL commented Dec 18, 2024

Not sure what to call this patch.

Shorts player type (Too generic sounding?) Change Shorts player type Open Shorts in regular player (too wordy?)

Shorts Player Bypassing? Shorts Player Overriding? 🤷‍♂️

@LisoUseInAIKyrios
Copy link
Contributor Author

Shorts player bypass sounds the best, even though it's not bypassing but instead changing.

@0xrxL
Copy link

0xrxL commented Dec 18, 2024

Shorts player bypass sounds the best, even though it's not bypassing but instead changing.

At this point ypu can use Replace instead Bypass.

@oSumAtrIX
Copy link
Member

Open Shorts in regular player or Open Shorts in normal player are fine. They explain exactly what the patch does.

@LisoUseInAIKyrios
Copy link
Contributor Author

Maybe Shorts player override is better. Bypass and replace could suggest some kind of hiding.

@LisoUseInAIKyrios
Copy link
Contributor Author

Open Shorts in regular player would be the most correct self description.

@LisoUseInAIKyrios LisoUseInAIKyrios changed the title feat(YouTube): Add Shorts player type patch feat(YouTube): Add Open Shorts in regular player patch Dec 18, 2024
@LisoUseInAIKyrios
Copy link
Contributor Author

I find that using the regular fullscreen player greatly reduces Shorts brain rot. Shorts no longer repeat and there is no swiping to the next Short. You watch the individual Short video you decided to open and that's all.

@0xrxL
Copy link

0xrxL commented Dec 18, 2024

I find that using the regular fullscreen player greatly reduces Shorts brain rot. Shorts no longer repeat and there is no swiping to the next Short. You watch the individual Short video you decided to open and that's all.

Plus, the stardard player controls can be hide or show with a single tap.

Shorts player is the worst thing even conceived.

@0xrxL
Copy link

0xrxL commented Dec 18, 2024

@LisoUseInAIKyrios Can you reproduce a shorts playback issue, when you try to open shorts section from launcher shortcuts, during a regular video is playing in background?

I think there is a problem with MainActivity intent check, that happen a too little instant before shorts section will become visibile.

@LisoUseInAIKyrios
Copy link
Contributor Author

LisoUseInAIKyrios commented Dec 18, 2024

Yes I can reproduce. Maybe can check if the app is currently in PiP mode when then short is attempting to open.

The hooked method has a map parameter that might indicate it's an app shortcut opening the Shorts player. Haven't checked the map contents.

@0xrxL
Copy link

0xrxL commented Dec 18, 2024

There's also a PostOnCreate() method, which is linked to the method that I used to check the current intent. Maybe can be used to anticipate the check.

Nevermind...the issue it's reproducible even with the patch disabled. So should be a stock bug.

@LisoUseInAIKyrios
Copy link
Contributor Author

LisoUseInAIKyrios commented Dec 19, 2024

Shorts app shortcut launch can be detected by checking the map parameters.

But, the bug is present in all targets of YouTube. The UI becomes broken if the Shorts app shortcut is used while a video is playing in background PiP. Older targets behave a little better, but they're still broken in some way.

This use case seems unusual and maybe it's why it's gone unnoticed by YouTube for so long.

Edit: I should have looked for the edit above.

@LisoUseInAIKyrios LisoUseInAIKyrios merged commit c7c5e5b into ReVanced:dev Dec 19, 2024
1 check passed
@LisoUseInAIKyrios LisoUseInAIKyrios deleted the feat/open_shorts_in_regular_player branch December 19, 2024 08:11
github-actions bot pushed a commit that referenced this pull request Dec 19, 2024
# [5.6.0-dev.1](v5.5.2-dev.2...v5.6.0-dev.1) (2024-12-19)

### Features

* **YouTube:** Add `Open Shorts in regular player` patch ([#4153](#4153)) ([c7c5e5b](c7c5e5b))
github-actions bot pushed a commit that referenced this pull request Dec 20, 2024
# [5.6.0](v5.5.1...v5.6.0) (2024-12-20)

### Bug Fixes

* **Twitter - Change link sharing domain:** Use correct extension package ([ad7fab6](ad7fab6))
* **YouTube - Force original audio:** Use correct original audio stream if app language is not English ([0d20171](0d20171))
* **YouTube - Hide layout components:** Hide new kind of community post ([#4155](#4155)) ([08f68cb](08f68cb))
* **YouTube - Miniplayer:** Use estimated maximum on screen size for devices with low density screens ([#4150](#4150)) ([2694158](2694158))
* **YouTube - Open Shorts in regular player:** Do not show the miniplayer after opening a Short while a video is playing ([894e366](894e366))
* **YouTube - SponsorBlock:** Show create new segment error messages using a dialog ([#4148](#4148)) ([5870906](5870906))
* **YouTube - Spoof video streams:** Change default spoofing to iOS, allow setting a default language with Android VR ([#4171](#4171)) ([171b4e7](171b4e7))
* **YouTube - Spoof video streams:** Update iOS client version ([df3aeed](df3aeed))

### Features

* **YouTube:** Add `Open Shorts in regular player` patch ([#4153](#4153)) ([c7c5e5b](c7c5e5b))
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.

feat(YouTube): Play Shorts with the regular video player
3 participants