ReVanced / revanced-patches

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

feat(YouTube): allow PiP (picture-in-picture) mode for Shorts live streams #2844

Closed philklc closed 4 months ago

philklc commented 7 months ago

Feature description

When switching away from YouTube during a livestream with the Shorts UI, allow playback to continue in picture-in-picture mode just like with ordinary videos

Motivation

It is now possible to livestream in Shorts now, but livestreams with the Shorts UI, just like Shorts, do not allow playback in picture-in-picture mode. This takes away the ability for the user to do other things on the device while listening to the streamer, especially when the stream is not visually important like chatting or singing.

Currently, with the patches, queuing an ordinary video before the Shorts livestream, and then getting the player to picture-in-picutre mode before the ordinary video ends, allows the Shorts livestream to be played in picture-in-picture, unlike the original YouTube that pauses at the thumbnail and shows an exclamation mark over the Play button.

This is clunky and it would be much appreciated to be able to play a Shorts livestream in picture-in-picture mode directly when switching away from the YouTube app, without the clunky workaround of using the queue feature.

To test, search for "縦型配信" and look for one that's live, as finished livestreams plays just like ordinary videos and do not use the Shorts UI.

Acknowledgements

Natsulus commented 6 months ago

When I was searching for a solution to the problem, I found a workaround in a 2 year old suggestion from the previous discussion repository that has it play in the normal player instead of the short player through putting it in a playlist (don't have to queue) similarly to what you've said as clunky.

Would love to see Shorts have background play & PiP working, or an option to force the normal player which can do it instead.

everypizza1 commented 6 months ago

The one time I've watched a YouTube Shorts livestream, PiP worked fine. I'll try again later if I see another livestream on Shorts.

LisoUseInAIKyrios commented 6 months ago

@everypizza1 to fully test that, you'll need to repatch and exclude Minimized playback (or use regular YT app with Premium), because the patch overrides YT and does not allow Shorts to play (even if YT would normally allow certain Shorts in the background).

everypizza1 commented 6 months ago

@everypizza1 to fully test that, you'll need to repatch and exclude Minimized playback (or use regular YT app with Premium), because the patch overrides YT and does not allow Shorts to play (even if YT would normally allow certain Shorts in the background).

I've just re-patched in an emulator without Minimized playback, and Shorts livestreams do have PiP. Screenshot_20240315_024013

LisoUseInAIKyrios commented 6 months ago

Post a link to a livestream Short. I could not find any when searching.

everypizza1 commented 6 months ago

The one I used in the screenshot just ended, so here's one that was randomly in my feed: https://www.youtube.com/live/JrW6ODmLuTI


From: LisoUseInAIKyrios @.> Sent: Friday, March 15, 2024 2:43:58 PM To: ReVanced/revanced-patches @.> Cc: Derry Tutt @.>; Mention @.> Subject: Re: [ReVanced/revanced-patches] feat:(YouTube) allow PiP (picture-in-picture) mode for Shorts livestreams (Issue #2844)

Post a link to a livestream Short. I could not find any when searching.

— Reply to this email directly, view it on GitHubhttps://github.com/ReVanced/revanced-patches/issues/2844#issuecomment-2000342601, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATXE5QMD7XJFQMTRZFWOP33YYNFP5AVCNFSM6AAAAABEIIN7Q6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBQGM2DENRQGE. You are receiving this because you were mentioned.Message ID: @.***>

Natsulus commented 6 months ago

I use the Minimized playback patch (no YT Premium), and shorts live stream PiP and background play don't work for me. An example that should be up most of the time that I know of is if you search "Tyra Soraduki" and look at her "24/7 Rock Sing Radio" which comes up as a shorts livestream when I access it normally.

everypizza1 commented 6 months ago

That's interesting, because it works for me with the minimized playback patch and in the normal YouTube app without premium, on multiple different accounts. Would there be a way to share my configuration without leaking my SponsorBlock UID?

LisoUseInAIKyrios commented 6 months ago

@everypizza1 a config won't matter for the situation.

It appears these videos are not Shorts, but are regular videos but with a vertical aspect ratio. Because the previously posted random live video was showing with a Shorts like player, but now that it's no longer live it is opening in the regular video player: https://www.youtube.com/live/JrW6ODmLuTI

if you search "Tyra Soraduki" and look at her "24/7 Rock Sing Radio" which comes up as a shorts livestream when I access it normally.

This videos does use the shorts like player, but it does not playback minimized for me (even if I manually force the minimized playback patch to always allow background play).

gokui commented 6 months ago

@everypizza1 a config won't matter for the situation.

It appears these videos are not Shorts, but are regular videos but with a vertical aspect ratio. Because the previously posted random live video was showing with a Shorts like player, but now that it's no longer live it is opening in the regular video player: https://www.youtube.com/live/JrW6ODmLuTI

if you search "Tyra Soraduki" and look at her "24/7 Rock Sing Radio" which comes up as a shorts livestream when I access it normally.

This videos does use the shorts like player, but it does not playback minimized for me (even if I manually force the minimized playback patch to always allow background play).

You can try this, open any short video and press screen to pause it, like this

464D7D20-1362-4DA6-8F7C-E94823D44491

then you can see a button that I make a mark on the picture ,press it then you will open the short livestream, then you can see your watch history in normal history.....yes, not in short watch history.

But youtube is very interesting. Somebody, some account whan they open short livestream in YT homepage(not in short video),they can open the short livestream in normal UI at all of their machine and app,iphone android or pc,YT offcial app, uyou or revanced.

So.....If I have a Feature request that is similar to this Feature request, I think we have the same reson, but defferent results. I need to open a new issue anyway?

Sorry I can't use english very well, please forgive me if I do something wrong.

philklc commented 6 months ago

YouTube might have changed something on their end, now Shorts livestreams can be played in PiP. I have YouTube Premium though

gokui commented 6 months ago

In fact, I am tired of the short livestream UI in the youtube homepage. When I select the livestream tag in yt home to look for a interest livestream, I select the first stream, it's a normal stream, then I slide down to go back to home, select the second stream, oh.. it's a short livestream, I need to press back bottom, and the third and fourth stream are normal stream again, the fifth is short stream...... It make me almost crazy. So, if we can open all streams(normal and short) in normal UI, maybe it wll be all ok? Someone want to play it with normal UI, select it in the option, others want to use short UI, don't select it.

oSumAtrIX commented 4 months ago

Over time, a lot of feature requests have been made, which is why I am closing some according to the contribution guidelines:

Requests can be accepted or rejected at the discretion of maintainers of ReVanced Patches

This feature request has been closed for one or more of the following reasons:

Regardless, anyone who comes across this feature request can PR it. Thanks for the feature request!