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

handle peertube video url intent #4853

Open
1 task done
test2a opened this issue Nov 10, 2020 · 8 comments
Open
1 task done

handle peertube video url intent #4853

test2a opened this issue Nov 10, 2020 · 8 comments
Labels
feature request Issue is related to a feature in the app peertube Service, https://joinpeertube.org/

Comments

@test2a
Copy link

test2a commented Nov 10, 2020

Checklist

Describe the feature you want

currently newpipe can play peertube urls just fine but cannot accept direct links from apps. as in, if i have to play a peertube video, i have to either search or copy url and paste in search to run.
i am proposing to add url intent just like "tubelab" a peertube android app does.
it looks for videos/watch in the url and tries to play it or throw to other apps if unable to.
look here.
https://framagit.org/tom79/fedilab-tube/-/commit/824c4e0cbbf693467d79ac4195611b10aeff10e5#e6606aeb8715512e114c47ddfcf04b979958e466_223_224

a simple regex

Pattern link = Pattern.compile("(https?://[\da-z.-]+\.[a-z.]{2,10})/videos/watch/(\w{8}-\w{4}-\w{4}-\w{4}-\w{12})$");

Is your feature request related to a problem? Please describe it

currently newpipe plays peertube videos but does not understand url intent like it does for youtube links. pressing any youtube url plays that video in newpipe or at least asks us to. not the case with peertube. they open in browser which is less than ideal.

Additional context

How will you/everyone benefit from this feature?

peertube compatibility would be better now that livestreaming is a thing on peertube.

@test2a test2a added the feature request Issue is related to a feature in the app label Nov 10, 2020
@opusforlife2 opusforlife2 added the peertube Service, https://joinpeertube.org/ label Nov 10, 2020
@Stypox
Copy link
Member

Stypox commented Nov 17, 2020

How did they add every possible url to the manifest? I don't understand from here

@test2a
Copy link
Author

test2a commented Nov 18, 2020

@stom79 should be able to help you with it. he is the lead developer on that

@ghost
Copy link

ghost commented Nov 18, 2020

It's in a flavor, so the logic is here https://github.com/stom79/TubeLab/blob/develop/app/src/fdroid_full/AndroidManifest.xml

         <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- The app is a good candidate for URL in https://domain.name/videos/watch/xxxxx-->
                <data
                    android:host="*"
                    android:pathPrefix="/videos/watch/"
                    android:scheme="https" />
            </intent-filter>

@Stypox
Copy link
Member

Stypox commented Nov 18, 2020

Oh, I see. @TobiGr @TheAssassin @B0pol @opusforlife2 do you think this should be added as it is, or do you think it will create problems?

@ghost
Copy link

ghost commented Nov 18, 2020

It should have very few FP (afaik) due to the pattern for path. But if there is one, it redirects the URL to other apps.

See, here for managing the intent:
https://github.com/stom79/TubeLab/blob/3351ef7d913fc4f3243b58d28a688ac724188a9c/app/src/main/java/app/fedilab/fedilabtube/PeertubeActivity.java#L504-L530

And here for forwarding to other apps:
https://github.com/stom79/TubeLab/blob/3351ef7d913fc4f3243b58d28a688ac724188a9c/app/src/main/java/app/fedilab/fedilabtube/helper/Helper.java#L762-L784

@opusforlife2
Copy link
Collaborator

I really like this solution. Could we use a pattern for Invidious as well?

@Stypox
Copy link
Member

Stypox commented Nov 18, 2020

But if there is one, it redirects the URL to other apps.

That's already implemented in NewPipe, so just changing the manifest would be ok

@Porrumentzio
Copy link

Have there been any news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app peertube Service, https://joinpeertube.org/
Projects
None yet
Development

No branches or pull requests

4 participants