spotify / web-playback-sdk

This issue tracker is no longer used. Join us in the Spotify for Developers forum for support with the Spotify Web Playback SDK ➡️ https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
106 stars 7 forks source link

How to Use The Spotify Web Playback SDK on a remote server ? #52

Open fvince25 opened 5 years ago

fvince25 commented 5 years ago

Issue found on DATE.

Scope(s):

Hi,

I am trying to make work the basic example of Web Playback SDK (https://developer.spotify.com/documentation/web-playback-sdk/quick-start/).

It works perfectly on my local, but it does not function at all on a remote server.

I get the following console error

(index):20 Failed to initialize player player.addListener @ (index):20 /favicon.ico:1 Failed to load resource: the server responded with a status of 404 (Not Found)

Any idea how to fix this ?

Is the kit intended to work only locally or also remotely ?

TY in advance.

Steps to reproduce:

Expected behaviour:

remote Web playback kit working in remote server

Actual behaviour:

remote Web playback kit working in local

itsjustbrian commented 5 years ago

I'm confused about what you mean by "local" vs "remote" in this scenario. The SDK will only work if loaded in a supported browser. It will not work in a server environment. You can see the support table here: https://developer.spotify.com/documentation/web-playback-sdk/

Do you mean you are seeing different behavior when running your app locally vs in a deployed environment?

fvince25 commented 5 years ago

Ty for your answer.

I mean :

Instead of running the initialization and launch html files locally (C://Path/of/the/files/), I run them from a remote server (http://www.remoteserver.xx) . You confirm it won't work this way ?

itsjustbrian commented 5 years ago

Ah I see. No it should work fine regardless of where you're serving the files from. Could be something to do with any build steps or lack thereof on local vs deployed. But I'm just guessing. I was able to deploy an app that loaded the SDK without a problem.

bichotll commented 5 years ago

An important note. The environment should be secure (https) from what I'm reading here: https://github.com/spotify/web-playback-sdk/issues/38

itsjustbrian commented 5 years ago

@fvince25 Was your issue resolved? If you so could you please close this issue?

fvince25 commented 5 years ago

Many thanks to you fafcrumb and bichotll. I have been busy lately for professional reasons. So I left this topic aside. But will I try to set up your solutions soon. I will keep you informed of the result.