Correction I originally wrote that Grayjay was FOSS, this isnāt true. Grayjay is simply source-available, even if the plugins actually are licensed under the GPL.
Grayjay appears to be intended to be a one-stop-shop for all of oneās digital consumption needs. It has support for YouTube, Rumble, Odysee, and others, but what got my attention was the PeerTube support.
I still donāt quite understand how plugins work under the hood. It seems that they inherit functionality from classes that provide standard interfaces for the client to use. Essentially the goal seems to be that every platform can be abstracted in the form of a plugin.
The Official Plugin
The PeerTube plugin has some issues. Itās not immediately apparent how to use your own peertube instance instead of FUTOs. The āopen in Grayjayā button just outright ignores whatever you add. So the easiest way to rectify that would be to hit the ācopy linkā button and open it from your android. If youāre having trouble with this, simply make a simple web link to the url with html, open it with the html viewer and click the link, or find a different way to send you the link as a hyperlink, just opening the link in your browser may not work.
So once thatās taken care of local peertube videos will work great! As of writing this I havenāt tested casting, but I know casting from other platforms works so I assume there arenāt issues there. The problem is that remote videos will all fail to load. When you open a link in grayjay itās designed to choose a plugin thatās authorized to open it, the app doesnāt seem to understand that the peertube plugin works for all peertube sites.
Thankfully thereās a fairly simple solution to this. The real reason remote videos fail is that the URL provided from the api call /api/v1/videos/
gives the remote url, not the local url. This confuses grayjay because it doesnāt realize that it can play the video.
Making my own
You see, a remote video on peertube can be loaded from the instances URL. So I simple forked the plugin and changed how remote videos are loaded.
Shamefully copied from my readme.md
in the repo:
Hopefully this specific plugin will be unnecessary. I forked the official peertube plugin because as it currently exists, it doesnāt properly load videos from remote instances.
My solution isnāt very elegant, Iām not familiar with typescript, but this plugin will allow you to browse videos within the network for the Libre Solutions Network PeerTube
Changes made:
Changing from trending peertube videos to most recent
Setting the baseURL to
peertube.libresolutions.network
To allow remote videos to load, i had to hardcode
getVideoPager
url parameter with:url: "https://peertube.libresolutions.network"+ v.url.substring(v.url.search("/videos/")),
*I also made a similar change elsewhere*
Why? Because when the peertube plugin loads a remote video it throws an error
No source enabled to support url
Meaning that you would need to install the peertube plug-in for every instance within your network.Thankfully peertube seamlessly handles links to remote videos when you replace it with your instance url.
Outstanding issues
- I would prefer to pull the baseURL parameter properly, but I had trouble making that work and decided to just hardcode it.
- I have no idea how/if this will impact casting, but hope to test that soon.
- I need to properly sign the plugin
If you have grayjay and want to give it a try feel free to install it from here.
Simply install the grayjay app and open that page, the install button will have grayjay load the plugin.
Iāve limited itās reach to only peertube.libresolutions.network
but you could fork your own and make it work for your instance.
Iām hoping the main peertube add-on gets fixed, and/or that the plugin system allows the user to configure variables like the baseURL
from within the plugin settings. Once thatās done, all that really needs to be done is for the plugin to properly add the configured baseURL to videos as they are loaded in.