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

Issue with spdr:// requestString #1164

Open
sodface opened this issue Sep 13, 2024 · 5 comments
Open

Issue with spdr:// requestString #1164

sodface opened this issue Sep 13, 2024 · 5 comments

Comments

@sodface
Copy link

sodface commented Sep 13, 2024

Does it make any sense to check for requestString and then call getRequestString? Am I reading this wrong?

my $methodHandler = $currentTrackHandler->can('requestString') ? $currentTrackHandler : $handler;
$request_string = $methodHandler->getRequestString($client, $url, undef, $params->{'seekdata'} || $controller->song->seekdata);

The SqueezePlayDirect protocol handler defines requestString:

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.

@michaelherger
Copy link
Member

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?

@sodface
Copy link
Author

sodface commented Sep 13, 2024

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

@sodface
Copy link
Author

sodface commented Sep 13, 2024

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.

sodface referenced this issue Sep 14, 2024
They are both needed (surprise...) when PH's don't descend from HTTP. Now, the requestString needed to be updated
@sodface
Copy link
Author

sodface commented Sep 14, 2024

I think this was broken in the above referenced commit.

@sodface
Copy link
Author

sodface commented Nov 8, 2024

@philippe44 can you take a look at this when you get a chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants