revanced-patches-template icon indicating copy to clipboard operation
revanced-patches-template copied to clipboard

feat: re-enable cast V1 on non-rooted builds

Open Canny1913 opened this issue 3 years ago • 32 comments

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.

Canny1913 avatar Jul 27 '22 20:07 Canny1913

Does the code for cast V1 even exist in youtube?

jr1221 avatar Jul 29 '22 00:07 jr1221

Yes it still exists.

Canny1913 avatar Jul 29 '22 06:07 Canny1913

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

Joomsy avatar Jul 29 '22 12:07 Joomsy

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

masterflitzer avatar Aug 09 '22 09:08 masterflitzer

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 avatar Aug 11 '22 08:08 Virusmater

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.

Virusmater avatar Aug 11 '22 11:08 Virusmater

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

masterflitzer avatar Aug 11 '22 11:08 masterflitzer

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

Joomsy avatar Aug 11 '22 19:08 Joomsy

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

masterflitzer avatar Aug 11 '22 21:08 masterflitzer

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.

Joomsy avatar Aug 11 '22 21:08 Joomsy

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?

masterflitzer avatar Aug 11 '22 21:08 masterflitzer

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.

Joomsy avatar Aug 11 '22 21:08 Joomsy

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)

masterflitzer avatar Aug 11 '22 22:08 masterflitzer

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?

InakiArzalluz avatar Aug 14 '22 22:08 InakiArzalluz

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.

Joomsy avatar Aug 14 '22 22:08 Joomsy

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

masterflitzer avatar Aug 14 '22 22:08 masterflitzer

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.

Joomsy avatar Aug 14 '22 23:08 Joomsy

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

I mean to the youtube app on roku.

InakiArzalluz avatar Aug 14 '22 23:08 InakiArzalluz

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

masterflitzer avatar Aug 14 '22 23:08 masterflitzer

how old/new is this app version?

It's version 2.22.105005075, from july 26 2022

InakiArzalluz avatar Aug 14 '22 23:08 InakiArzalluz

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

masterflitzer avatar Aug 14 '22 23:08 masterflitzer

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

Canny1913 avatar Aug 14 '22 23:08 Canny1913

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

masterflitzer avatar Aug 14 '22 23:08 masterflitzer

uh no sorry

Canny1913 avatar Aug 14 '22 23:08 Canny1913

no worry's thanks

masterflitzer avatar Aug 14 '22 23:08 masterflitzer

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.

InakiArzalluz avatar Aug 15 '22 00:08 InakiArzalluz

thanks i definitely learned new things

masterflitzer avatar Aug 15 '22 06:08 masterflitzer

Both cast V1 and V2 are fixed.

Canny1913 avatar Aug 15 '22 16:08 Canny1913

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

masterflitzer avatar Aug 15 '22 16:08 masterflitzer

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

Canny1913 avatar Aug 15 '22 16:08 Canny1913