I'm developing a new music service for Sonos. I have the SMAPI service working properly. I can even play audio from it, albeit, only when I direct the mediaUrl to a regular .mp3 file.
I'm now going the next step and having it pull a live HLS stream instead of a static .mp3 file.
I've reviewed the relevant documentation about Sonos's support for HLS and I appear to be implementing all the relevant details. (i.e. The mimetype must be application/vnd.apple.mpegurl or one of a couple of other options. etc.)
When fetching the medualUrl, Sonos will receive a chain of two 302 redirects before the initial m3u8 file is returned. But that appears to work fine with static content which used a single redirect.
When my service issues the second redirect, I don't see Sonos making a request to the URL specified in its Location header. It appears to just dislike the response, but I don't know why.
Perhaps Sonos simply refuses to follow more than one 302 redirect? [EDIT: No, I set up a chain of 4 redirects in the static-file working case and it followed them just fine]
The error in the Sonos mobile is simply "Unable to play Title - unable to connect to Music Service Name"
Are there any available logs that could shed light and help to troubleshoot why Sonos is rejecting the playback request?
Also, while the Sonos device is not getting this far in the process yet, I do have a web-based player that plays from my HLS service just fine with all the same redirects involved.
I have found the problem.
Sonos, only when streaming HLS, will not follow 30x redirects when the Location header is a relative URL. It will follow them if the Location header has an absolute URL.
This is an apparent bug as the header is allowed to be relative or absolute.
c.f.
Nevertheless, I would still advocate for there being some access to error logs within the Sonos device.