clapper icon indicating copy to clipboard operation
clapper copied to clipboard

[clapper-app]: handle clapper:// uri scheme

Open GeopJr opened this issue 7 months ago • 5 comments

(Making this request as a user)

What if there was a clapper:// uri scheme that did the same as pasting the url here:

Image

That way users could open videos in clapper by just replacing https with clapper.

E.g. https://www.youtube.com/watch?v=... => clapper://www.youtube.com/watch?v=...

I also had the idea of a browser extension like the way firefox does "Open in popup" but with Clapper 🤔

GeopJr avatar Apr 28 '25 16:04 GeopJr

replacing https with clapper

One problem with it is we can only guess for "https" when converting URI back. This would make things that have custom URI schemes upon which GStreamer operates (and we take advantage of that) unplayable even if app is spawned to open them (examples being file, dvb, dvd, cdda protocols and also self hosted services like peertube, lbry).

What makes this even trickier is that GStreamer and Clapper too in case of things handled by enhancers, operates with a dynamically loadable (and optional) plugins. So we cannot really hardcode all other possibilities to handle in addition to clapper:// scheme.

I do not have any idea how to make clapper:// work for everything that player on a given computer supports 😥 . I can imagine however a custom implementation of Clapper for an app like YouTube client (e.g. Pipeline) and having a custom scheme handler in that app. This way, user will not get disappointed that YouTube client couldn't open non-youtube link.

I also had the idea of a browser extension like the way firefox does "Open in popup" but with Clapper 🤔

I think something like that already exists. Although I haven't looked at its code: https://github.com/abhijeeth-babu/send-to-clapper

Rafostar avatar Apr 28 '25 17:04 Rafostar

One problem with it is we can only guess for "https" when converting URI back

Would just filling the "Add URI" entry better? That way users can edit the scheme themselves. But then again that might be too technical for the average user :P

https://github.com/abhijeeth-babu/send-to-clapper

Ohhhh interesting, that's exactly what I wanted to do! I'll see if they are open to some PRs and maybe I can help publishing it to Chrome too!


Since that exists, I don't really have a use for clapper:// and I'm okay with closing it!

GeopJr avatar Apr 28 '25 17:04 GeopJr

Would just filling the "Add URI" entry better? That way users can edit the scheme themselves. But then again that might be too technical for the average user :P

This would kinda defeat the purpose of custom handler if user has to "fix" it afterwards in yet another dialog and then click open/add 😄 . I would rather try to avoid implementing totally different treatment of some URIs. Currently Clapper just makes a new media item with URI as-is, adds it to the playback queue and that's it.

I guess, one idea would be resolving: clapper://example.com?key=val&clapper_scheme=peertube -> peertube://example.com?key=val and then handling is as normal.

I don't really have a use for clapper:// and I'm okay with closing it!

I will leave this open as a non-top priority issue then.

Rafostar avatar Apr 28 '25 18:04 Rafostar

I guess, one idea would be resolving: clapper://example.com?key=val&clapper_scheme=peertube -> peertube://example.com?key=val and then handling is as normal.

Alternatively you could URI-escape the actual URI including the protocol and pass that with the clapper:// URI. I've seen this done on Android by some ContentProvider implementations.

sp1ritCS avatar Apr 28 '25 19:04 sp1ritCS

Alternatively you could URI-escape the actual URI including the protocol and pass that with the clapper:// URI. I've seen this done on Android by some ContentProvider implementations.

Thats even better! This way, when/how to handle it could be implemented too. For example:

  • clapper://open?uri=ENCODED_URI - open immediately for playback
  • clapper://enqueue?uri=ENCODED_URI - append it to the end of queue (without selecting immediately)

And this would be in sync with already present Clapper command line --enqueue option (just trigger the same logic).

Rafostar avatar Apr 28 '25 19:04 Rafostar