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): Use cast V1 on non-rooted builds #2323

Open
ghost opened this issue Jul 27, 2022 · 36 comments
Open

feat(YouTube): Use cast V1 on non-rooted builds #2323

ghost opened this issue Jul 27, 2022 · 36 comments

Comments

@ghost
Copy link

ghost commented Jul 27, 2022

Type

Functionality

Issue

Currently, cast is entirely disabled on the non-rooted variant even if cast V1 works without an issue. This is obviously not ideal.

Feature

Modify microg-support patch and only enable cast V1.

Motivation

Play Services have the ability to fallback to using V1 if V2 is disabled. This way cast can function perfectly even if only V1 is enabled.

Additional context

Removing cast V2 function completely causes the cast button to break. Alternative solution: shortcut icon to link to a TV which is available in the settings.

@jr1221
Copy link

jr1221 commented Jul 29, 2022

Does the code for cast V1 even exist in youtube?

@ghost
Copy link
Author

ghost commented Jul 29, 2022

Yes it still exists.

@Joomsy
Copy link

Joomsy commented Jul 29, 2022

Seconding this request. Alternative clients like SmartTubeNext and Kodi's YouTube addon rely on V1 in order to be discoverable.

@masterflitzer
Copy link

I made an alternative suggestion in this issue 78
might be a sufficient workaround for most people (including me)

@Virusmater
Copy link

Were using Vanced with MicroG on non-rooted phone for years and casting to SmartTubeNext without any problems. Would love to have the cast button back.

@Virusmater
Copy link

Found on reddit, it is possible to bring back cast icon and it works fine with SmartTubeNext

You have to go to the "Revanced settings --> layout settings" then activate the "cast button" option, then on the chromecast navigate to set --> tv code.  add this tv code after clicking on cast in Revanced,
and you're done.

@masterflitzer
Copy link

yes you're right, hide cast button seems to just hide it but with the option to change it back

my suggestion is therefore not needed at all

i think when we don't include hide cast button patch explicitly (only microg patch) the cast button should stay enabled with the option to disable it

@Joomsy
Copy link

Joomsy commented Aug 11, 2022

Found on reddit, it is possible to bring back cast icon and it works fine with SmartTubeNext

You have to go to the "Revanced settings --> layout settings" then activate the "cast button" option, then on the chromecast navigate to set --> tv code.  add this tv code after clicking on cast in Revanced,
and you're done.

This is true, and always has been, but it's not what I'm referring to. The DLNA broadcast relies on V1. This is what makes the device name show up under the cast menu. Linking with a code has always been possible, even with the button disabled. You do it in the app's settings under "Watch on TV".

@masterflitzer
Copy link

ok so cast v1 really does mean that it shows up in the list automatically? I didn't know that sry

is the stock YouTube app for Android TV still broadcasting over v1 (meaning both v1 and v2)? I thought google switched to v2 only (idk but I read it somewhere on GitHub or reddit)

anyway for me tv code is enough as I'm using smarttubenext and there tv code is the only option

but of course having feature parity with vanced should be the goal so this would be nice to have

@Joomsy
Copy link

Joomsy commented Aug 11, 2022

ok so cast v1 really does mean that it shows up in the list automatically? I didn't know that sry

is the stock YouTube app for Android TV still broadcasting over v1 (meaning both v1 and v2)? I thought google switched to v2 only (idk but I read it somewhere on GitHub or reddit)

anyway for me tv code is enough as I'm using smarttubenext and there tv code is the only option

but of course having feature parity with vanced should be the goal so this would be nice to have

Right, it's not that big of a deal. Just makes things a bit more convenient, especially when you have multiple devices casting at once. And you're right, the official YouTube apps are V2 only now. STN won't show on the official mobile app, either.

@masterflitzer
Copy link

wait, what use does cast v1 have then? if official YT uses v2 only and STN doesn't support v1 either...

are there other 3rd party apps that implement v1?

@Joomsy
Copy link

Joomsy commented Aug 11, 2022

wait, what use does cast v1 have then? if official YT uses v2 only and STN doesn't support v1 either...

are there other 3rd party apps that implement v1?

STN does support V1. V1 is an open API that's free to use by third parties. Only Google can use V2. They haven't said that they're going to shut down V1, but Google being Google, anything's possible. They're definitely trying to make it more difficult to use.

@masterflitzer
Copy link

hmm for me STN didn't pop up automatically in old vanced, might try in official YT app

but afaik only official YT Android TV works with official YT (with cast v2)

@InakiArzalluz
Copy link

I just casted to a roku express and it was auto detected, and all I had to do was unhide the cast button. Isn't it supposed to not work?

@Joomsy
Copy link

Joomsy commented Aug 14, 2022

I just casted to a roku express and it was auto detected, and all I had to do was unhide the cast button. Isn't it supposed to not work?

The YouTube app for Roku was discontinued, meaning it likely has an older version of the casting API that still works for some reason. That, or it performs a DLNA broadcast independent of YouTube, which I know it does for some things. Roku also has multicast DNS support, which may be what's causing it to be listed. That's my best guess, though. My Roku Ultra also gets detected, for what it's worth.

@masterflitzer
Copy link

masterflitzer commented Aug 14, 2022

casted to a roku express

do you mean to the youtube app on roku or to roku itself (i dont have one but i heard you can cast to it directly),
i might be totally wrong but i think its most likely the youtube app on roku you are casting to (because i don't think roku would have google cast built in), which in turn makes me wonder why its different on roku vs android tv

older version of the casting API

but didn't they say cast v1 doesn't work in revanced?
maybe revanced didn't change anything except for hiding the cast button, which means cast v1 works (because microg is the service that implements it)

i wouldn't know because the official youtube app on android tv only does cast v2 apparently and i'm still not sure if smarttubenext even supports cast v1 (so it very well may be that v1 works on revanced but nobody noticed because there aren't many receivers left for v1)

DLNA broadcast
multicast DNS

does youtube even support protocols other than google cast? i didn't think so

@Joomsy
Copy link

Joomsy commented Aug 14, 2022

Yes, STN supports V1. It used to show up in the last official version of Vanced. And Google's casting is just their fancy version of DLNA. Functionally speaking, there's really not much of a difference between the two. Multicast DNS is just a simple way to assign local domain names to networked devices so they don't have to be found by IP. This helps the Roku be more easily detected when another device is searching for networked devices. My line of thinking is mDNS may be helping in this regard.

@InakiArzalluz
Copy link

do you mean to the youtube app on roku or to roku itself

I mean to the youtube app on roku.

@masterflitzer
Copy link

youtube app on roku

how old/new is this app version? it's indeed likely that it supports cast v1, then i'm wondering if maybe this issue is solved (maybe unhide cast button by default because at this point i don't even know why they hid it)

yes i know mDNS but didn't know google cast is similar to DLNA
still i think youtube only supports google cast (google wouldn't even allow miracast in official android anymore, samsung etc. had to reimplement it)

would be nice if someone from revanced team could say if revanced does support cast v1 currently (or if they even changed anything because if not then it should work like in vanced), it's really difficult to explain the current behavior

i can't seem to test it correctly because my STN doesn't show up in official yt or revanced and official yt androidtv only supports cast v2

@InakiArzalluz
Copy link

how old/new is this app version?

It's version 2.22.105005075, from july 26 2022

@masterflitzer
Copy link

ok that's not really old but it's possible that they still rely on cast v1 on roku because it doesn't have google play services (because it's not android)

most plausible explanation i currently have is this: revanced only hid the cast button, cast v1 is actually working fine, youtube on android tv only supports cast v2 and STNs cast v1 is very unreliable and therefore isn't working for me

we would need a reliable way to check casting capability to be sure but idk

@ghost
Copy link
Author

ghost commented Aug 14, 2022

both v1 and v2 doesnt work currently
and both modules are disabled in microg-support patch

@masterflitzer
Copy link

thanks for the information, do you have maybe an explanation how casting to roku is possible?

@ghost
Copy link
Author

ghost commented Aug 14, 2022

uh no sorry

@masterflitzer
Copy link

no worry's thanks

@InakiArzalluz
Copy link

do you have maybe an explanation how casting to roku is possible?

after a little google searching I found out that Youtube on Roku is using DIAL protocol.
That being said, I won't clutter this thread any longer, since I was only confused about the protocol being used on the device.

@masterflitzer
Copy link

thanks i definitely learned new things

@ghost
Copy link
Author

ghost commented Aug 15, 2022

Both cast V1 and V2 are fixed.

@masterflitzer
Copy link

how is v2 fixed? i'm not sure i understand

@ghost
Copy link
Author

ghost commented Aug 15, 2022

i dont even know lol
it casts to my tv without issues (vanced still gives error)

@masterflitzer
Copy link

that's weird, you are still using non-root build? v2 shouldn't be possible because it needs official google services

@ghost
Copy link
Author

ghost commented Aug 24, 2022

It worked for first few tries then failed again.
It keeps trying to use play services for cast.

@revanced-bot revanced-bot transferred this issue from ReVanced/revanced-patches-template Dec 14, 2023
@alexandreteles alexandreteles transferred this issue from another repository Dec 14, 2023
Slenderman00 pushed a commit to Slenderman00/revanced-patches-grindr that referenced this issue Jan 31, 2024
# [2.175.0-dev.15](ReVanced/revanced-patches@v2.175.0-dev.14...v2.175.0-dev.15) (2023-05-30)

### Bug Fixes

* **youtube/remember-video-quality:** fix typo in video resolutions ([ReVanced#2323](ReVanced/revanced-patches#2323)) ([a99cef8](ReVanced/revanced-patches@8d58d48))
Slenderman00 pushed a commit to Slenderman00/revanced-patches-grindr that referenced this issue Jan 31, 2024
# [2.175.0](ReVanced/revanced-patches@v2.174.0...v2.175.0) (2023-05-31)

### Bug Fixes

* **settings:** sort setting preferences using lowercase ([ReVanced#2312](ReVanced/revanced-patches#2312)) ([2743a95](ReVanced/revanced-patches@38e433d))
* **spoof-wifi-connection:** use updated instruction indices ([ReVanced#2199](ReVanced/revanced-patches#2199)) ([76fb700](ReVanced/revanced-patches@815f764))
* **youtube/downloads:** rename patch to `external-downloads` ([ReVanced#2274](ReVanced/revanced-patches#2274)) ([4480911](ReVanced/revanced-patches@238f7f2))
* **youtube/hide-info-cards:** fix hide-info-cards setting does not work ([ReVanced#2246](ReVanced/revanced-patches#2246)) ([72773ac](ReVanced/revanced-patches@5163022))
* **youtube/hide-player-buttons:** fix previous/next button showing if previous video exists ([ReVanced#2261](ReVanced/revanced-patches#2261)) ([91d1aab](ReVanced/revanced-patches@258c550))
* **youtube/hide-shorts-components:** clarify settings switch ([ReVanced#2276](ReVanced/revanced-patches#2276)) ([3e6d052](ReVanced/revanced-patches@8caa103))
* **youtube/integrations:** fix playback of embedded videos ([ReVanced#2304](ReVanced/revanced-patches#2304)) ([1dffbaf](ReVanced/revanced-patches@ec8c4e2))
* **youtube/remember-video-quality:** fix typo in video resolutions ([ReVanced#2323](ReVanced/revanced-patches#2323)) ([a99cef8](ReVanced/revanced-patches@8d58d48))
* **youtube/remove-player-controls-background:** use correct patch name and description ([8732a84](ReVanced/revanced-patches@a8ca870))
* **youtube/theme:** use dynamic background color for custom splash screen ([ReVanced#2319](ReVanced/revanced-patches#2319)) ([28594f3](ReVanced/revanced-patches@4552fe7))

### Features

* **nfctoolsse:** add `unlock-pro` patch ([ReVanced#2272](ReVanced/revanced-patches#2272)) ([9789ad3](ReVanced/revanced-patches@a107e1e))
* **remove-screen-capture-restriction:** remove app constraint ([ReVanced#2260](ReVanced/revanced-patches#2260)) ([49ce47c](ReVanced/revanced-patches@ee1d7fb))
* **scbeasy:** add `remove-debugging-detection` patch ([ReVanced#2287](ReVanced/revanced-patches#2287)) ([53d91e3](ReVanced/revanced-patches@1fc06ff))
* **tiktok:** remove compatibility version constraints ([ReVanced#2306](ReVanced/revanced-patches#2306)) ([a12c4bb](ReVanced/revanced-patches@86a4867))
* **youtube/general-ads:** merge `hide-get-premium` patch into `general-ads` patch ([5195dd8](ReVanced/revanced-patches@2a88347))
* **youtube/hide-seekbar:** more fine grained hiding of seekbar ([ReVanced#2252](ReVanced/revanced-patches#2252)) ([0f07bf4](ReVanced/revanced-patches@5d39f64))
* **youtube/hide-shorts-components:** hide channel bar & sound button ([749c83d](ReVanced/revanced-patches@7ef8526))
* **youtube/hide-shorts-components:** hide shorts info panel ([ReVanced#2278](ReVanced/revanced-patches#2278)) ([a5b323d](ReVanced/revanced-patches@dc28b9a))
* **youtube/navigation-buttons:** use a better preference screen title ([5d7772b](ReVanced/revanced-patches@ecc70ad))
@Theletha
Copy link

Is this why I can't see my chromecastultra in the cast menu? I keep having to switch to the original app to cast content.

@oSumAtrIX
Copy link
Member

Casting is limited by GmsCore/ MicroG.

@Theletha
Copy link

Casting is limited by GmsCore/ MicroG.

Will it be fixed?

@oSumAtrIX
Copy link
Member

Thats not up to us

tamnguyenchi93 pushed a commit to tamnguyenchi93/revanced-patches that referenced this issue Mar 24, 2024
# [2.175.0-dev.15](ReVanced/revanced-patches@v2.175.0-dev.14...v2.175.0-dev.15) (2023-05-30)

### Bug Fixes

* **youtube/remember-video-quality:** fix typo in video resolutions ([ReVanced#2323](ReVanced/revanced-patches#2323)) ([a99cef8](ReVanced/revanced-patches@a99cef8))
tamnguyenchi93 pushed a commit to tamnguyenchi93/revanced-patches that referenced this issue Mar 24, 2024
# [2.175.0](ReVanced/revanced-patches@v2.174.0...v2.175.0) (2023-05-31)

### Bug Fixes

* **settings:** sort setting preferences using lowercase ([ReVanced#2312](ReVanced/revanced-patches#2312)) ([2743a95](ReVanced/revanced-patches@2743a95))
* **spoof-wifi-connection:** use updated instruction indices ([ReVanced#2199](ReVanced/revanced-patches#2199)) ([76fb700](ReVanced/revanced-patches@76fb700))
* **youtube/downloads:** rename patch to `external-downloads` ([ReVanced#2274](ReVanced/revanced-patches#2274)) ([4480911](ReVanced/revanced-patches@4480911))
* **youtube/hide-info-cards:** fix hide-info-cards setting does not work ([ReVanced#2246](ReVanced/revanced-patches#2246)) ([72773ac](ReVanced/revanced-patches@72773ac))
* **youtube/hide-player-buttons:** fix previous/next button showing if previous video exists ([ReVanced#2261](ReVanced/revanced-patches#2261)) ([91d1aab](ReVanced/revanced-patches@91d1aab))
* **youtube/hide-shorts-components:** clarify settings switch ([ReVanced#2276](ReVanced/revanced-patches#2276)) ([3e6d052](ReVanced/revanced-patches@3e6d052))
* **youtube/integrations:** fix playback of embedded videos ([ReVanced#2304](ReVanced/revanced-patches#2304)) ([1dffbaf](ReVanced/revanced-patches@1dffbaf))
* **youtube/remember-video-quality:** fix typo in video resolutions ([ReVanced#2323](ReVanced/revanced-patches#2323)) ([a99cef8](ReVanced/revanced-patches@a99cef8))
* **youtube/remove-player-controls-background:** use correct patch name and description ([8732a84](ReVanced/revanced-patches@8732a84))
* **youtube/theme:** use dynamic background color for custom splash screen ([ReVanced#2319](ReVanced/revanced-patches#2319)) ([28594f3](ReVanced/revanced-patches@28594f3))

### Features

* **nfctoolsse:** add `unlock-pro` patch ([ReVanced#2272](ReVanced/revanced-patches#2272)) ([9789ad3](ReVanced/revanced-patches@9789ad3))
* **remove-screen-capture-restriction:** remove app constraint ([ReVanced#2260](ReVanced/revanced-patches#2260)) ([49ce47c](ReVanced/revanced-patches@49ce47c))
* **scbeasy:** add `remove-debugging-detection` patch ([ReVanced#2287](ReVanced/revanced-patches#2287)) ([53d91e3](ReVanced/revanced-patches@53d91e3))
* **tiktok:** remove compatibility version constraints ([ReVanced#2306](ReVanced/revanced-patches#2306)) ([a12c4bb](ReVanced/revanced-patches@a12c4bb))
* **youtube/general-ads:** merge `hide-get-premium` patch into `general-ads` patch ([5195dd8](ReVanced/revanced-patches@5195dd8))
* **youtube/hide-seekbar:** more fine grained hiding of seekbar ([ReVanced#2252](ReVanced/revanced-patches#2252)) ([0f07bf4](ReVanced/revanced-patches@0f07bf4))
* **youtube/hide-shorts-components:** hide channel bar & sound button ([749c83d](ReVanced/revanced-patches@749c83d))
* **youtube/hide-shorts-components:** hide shorts info panel ([ReVanced#2278](ReVanced/revanced-patches#2278)) ([a5b323d](ReVanced/revanced-patches@a5b323d))
* **youtube/navigation-buttons:** use a better preference screen title ([5d7772b](ReVanced/revanced-patches@5d7772b))
@LisoUseInAIKyrios LisoUseInAIKyrios changed the title feat: re-enable cast V1 on non-rooted builds feat(YouTube): Use cast V1 on non-rooted builds Apr 2, 2024
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

No branches or pull requests

7 participants