gui1117 / YouTubeStream

Apache License 2.0
13 stars 4 forks source link

Deep linking #3

Closed JackDesBwa closed 4 years ago

JackDesBwa commented 5 years ago

In Android, you can add a relation between your app and specific URLs with deep linking https://developer.android.com/training/app-links/deep-linking

You could add applicable intent-filter tags to be associated with m.youtube.com so that YouTubeStream appear in the related menus. For example in Firefox mobile, a small icon appears on the filtered URLs and it allows to open the related app(s) very quickly.

gui1117 commented 4 years ago

oh interesting thanks

JackDesBwa commented 4 years ago

Thanks for your app in the first place.

I considered creating a pull request, but it has been a while since I worked on Android apps and it was not in Kotlin so setting up the environment and learning a new language would have taken a lot of time for such a minor modification. I will be happy when I will see this functionality in the F-Droid update when you would have found a few time to add it. I do not use the Youtube app so having access through the browser more easily will be very convenient.

By the way, my main usage of your app is not to read the videos in background as suggested in the README, but to open the 3D videos in an appropriate player which formats the videos to be displayed on the autostereoscopic screen (ie. 3D without glasses) of my phone. Playing regular videos with gesture-enabled player is very appreciated too.

If you need some tester for this functionality, you can contact me.

gui1117 commented 4 years ago

If you developed with android studio in java you shouldn't be lost. Also kotlin has very similar concept, just a slightly different syntax. But I might do it when I got time

Interesting usage :-) I might add this in the readme

gui1117 commented 4 years ago

I tried a bit, but actually I don't know where this deep link can be triggered like when I'm on firefox and I click share if I click again on the link it opens with firefox without asking. (hmm maybe I have to reset some default)

do you have a precise user story in mind ?

gui1117 commented 4 years ago

maybe I just mixed stuff

JackDesBwa commented 4 years ago

I understand the big picture of the code based on other languages I know, and I would quickly learn what is needed for sure, but the environment is really what would slow me. According to Wikipedia, Android Studio did not exist when I worked on Android in java... it has been a while, truly.

Concerning the access to this functionality, a simple image will show more than words:

openwith

The choice is probably not proposed if a default application is associated.

gui1117 commented 4 years ago

implemented on master here https://github.com/thiolliere/YouTubeStream/commit/c471dcb39a84a5a1a9ef8f1cf5e74b5f53026513#diff-c8cc2dd42271f2bf39c6aa81eb6a5529

I'll try to make a new release soon

gui1117 commented 4 years ago

ok just as a note I made a quite unprecise intent-filter with

                <data android:scheme="https" android:host="youtu.be" />
                <data android:scheme="https" android:host="m.youtube.com" />
                <data android:scheme="https" android:host="youtube.com" />
                <data android:scheme="https" android:host="www.youtube.com" />

We could add watch path prefix on *.youtube.com but I'm not sure it is restrictive so I prefered implement this. though I don't really mind narrowing it.

Also I push new 1.1 and f-droid should be automatic versionning so I think it is just a matter of 24h to get the new release. (first f-droid update for me :-)

thanks again feel free to open if something is wrong :-)

JackDesBwa commented 4 years ago

Updated today through f-droid, it works fine. Thanks for your addition.