local url for /speaker command

local url for /speaker command

edited 08/25/2019 - 14:02 in SoundTouch API
kdw2060kdw2060 Posts: 13Member
Hi,

i'm trying to play a locally saved mp3 via the /speaker command. My url parameter is something like http://localhost:3001/message.mp3
However I get an error response when trying to post that message (the post works fine if i use a web url). I could try setting up dyndns and portforwarding, but i'd rather not make the message file publicly available on the internet, as these are private messages that I want to broadcast over my speakers.

Is playing locally hosted files possible in any way? Or is there a possible workaround for this?

btw, the error I see in PostMan is:
<?xml version="1.0" encoding="UTF-8" ?><Error value="415" name="HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE" severity="Unknown">media referenced by url is not supported by speaker</Error>

But i don't think that the problem is actually the media type format, tried several mp3 files.


EDIT/UPDATE:
Actually, nevermind, seems like I was too quick to post the question. Replacing localhost with the local ip-adress of my pc fixed the issue.
I'll leave the post here for others who might be trying to do the same thing.

Comments

  • kdw2060kdw2060 Posts: 13Member
    I should learn to test more before i post stuff  :D

    Still have an issue: posting the command now works via Postman, but not when I try to do it from my app with a jquery ajax request. The exact same function but with a web-url specified works fine.
  • kdw2060kdw2060 Posts: 13Member
    It was also due to the new Cors restrictions, see forum discussion 637. Works when moved to backend of the app.
Sign In or Register to comment.