ipfs / ipfs-desktop

An unobtrusive and user-friendly desktop application for IPFS on Windows, Mac and Linux.
https://docs.ipfs.tech/install/ipfs-desktop/
MIT License
5.99k stars 865 forks source link

Use user defined video player when watching a video from a node #2500

Open constraintAutomaton opened 1 year ago

constraintAutomaton commented 1 year ago

Is your feature request related to a problem? Please describe. When I have video in my node, I would like to use my own video player to watch them instead of the built-in the ipfs-desktop video player.

Describe the solution you'd like I want a button to open the video in my video player.

Describe alternatives you've considered I don't have an alternative

Additional context None

welcome[bot] commented 1 year ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

whizzzkid commented 1 year ago

Thanks for this issue @constraintAutomaton this sounds like an interesting idea, I tried opening a video link in my local VLC, while http://localhost:<PORT>/ipfs/<CID> loaded almost instantly, resolving it over a public gateway took a really long time.

However, that being said, I feel the problem is a bit more complicated than that. Opening media links from electron, is not trivial, because electron has no idea around what media players you have available. Running a command like open https://ipfs.io/ipfs/<CID> will open the browser and maybe trigger a download instead of opening it in the media player.

Think of it as youtube, can the link be opened directly in a generic external media player? The same conventions apply in this case. The only way I can think of is probably either pasing link to the localfile (which does not exactly exist in the conventional sense) or serve a media stream url, which somehow triggers OS's link handling mechanism.

@SgtPooki what do you think about this?

constraintAutomaton commented 1 year ago

I saw an electron app; freetube, support opening external media player. So it seems like it can be done.

SgtPooki commented 1 year ago

@whizzzkid I think this would be a great addition. If the bytes aren't stored in a file on the filesystem, we'll have to link to the file via the local gateway URL. Also, this code change would ideally belong in ipfs-webui, so I doubt an electron-specific technology would work here.

whizzzkid commented 1 year ago

@SgtPooki but how would webui trigger loading videos in an external player? are you thinking in terms of creating a custom m3u playlist that will point the player to a stream? I think that's how peertube does it aswell.

SgtPooki commented 1 year ago

My comment wasnt super clear sorry, yea some action on the video view to get the url to use is probably the best we can do.

Honestly, an explainer in readme/docs that explains how to watch video provided by ipfs-desktop (or node backing webui) using an external player should resolve this. This should already be possible via Kubo's local gateway.

whizzzkid commented 1 year ago

And it sorta works, I can add the stream url to VLC and it works (albeit slow) mostly as expected. I think this idea still has some weight, but if we plan to work on that I'd like to think in much broader terms, like a file-handler-plugin mechanism, which loads configured files in their respective apps. images -> preview, videos -> vlc, pdf -> adobe, etc.