Open sodface opened 2 weeks ago
TBH: I've long forgotten what the spdr
protocol handler is supposed to do. Can you tell a little more about what you're trying to do?
The comment in SqueezePlayDirect.pm
probably says it better than I can:
# protocol handler for the pseudo protocol spdr://
# This is used to allow remote urls to be passed direct to SqueezePlay clients
# SqueezePlay will then use applet handlers to decide how to parse/play the stream
# This allows SqueezePlay applets to extend playback functionality by requesting
# the server to play a url which will then be interpreted by another part of the applet
# urls are of the form:
#
# spdr://<handler>?params...
#
# where handler identifies a specific playback handler within SP
I have mpv working pretty well as a squeezebox player using a c-plugin that borrows heavily from existing c code, mostly from squeezeslave for the slimproto stuff. Basically, all the mpv c-plugin does is handle the slimproto comms with LMS and then issues commands to mpv to open files/urls and control playback, volume, etc.
Since mpv plays video, I was testing how to pass a video url from LMS to mpv, with the idea of perhaps working on a plugin, but I wanted to come up with a method before going any further. The spdr:// format seemed to do what I wanted.
For testing, I made a short playlist consisting of a remote .mp3 file (random from a google search), a local .mp3 file on my server, and then a remote .mp4 video.
A playlist with these entries plays the first two files and then does not play the third:
https://themamaship.com/music/Catalog/Sweet%20Home%20Alabama.mp3
http://10.0.0.10/repo/misc/preemph_test/test.mp3
https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4
If I change the third entry for the video to use the spdr:// prefix it works (after making the code change noted in my first post):
https://themamaship.com/music/Catalog/Sweet%20Home%20Alabama.mp3
http://10.0.0.10/repo/misc/preemph_test/test.mp3
spdr://mpv?url=https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4
Well, I should note too that I had to handle the spdr:// url in my c-plugin code but that's on the client side.
I think this was broken in the above referenced commit.
Does it make any sense to check for
requestString
and then callgetRequestString
? Am I reading this wrong?https://github.com/LMS-Community/slimserver/blob/b4c87de36104045421b6432acb921dafa7866ef6/Slim/Player/Squeezebox.pm#L794-L795
The SqueezePlayDirect protocol handler defines
requestString
:https://github.com/LMS-Community/slimserver/blob/b4c87de36104045421b6432acb921dafa7866ef6/Slim/Player/Protocols/SqueezePlayDirect.pm#L46
I'm testing using spdr:// formatted urls and was having issues getting
Squeezebox.pm
to send the strm command with an spdr:// url until I edited line 795 to$methodHandler->requestString
and then it started working as expected.