Help Wizard

Step 1


Web Playback SDK lifecycle

Web Playback SDK lifecycle



I'm building a web application using the Web Playback SDK. First of all, I am absolutely thrilled how easy it was to get going with this and the features that it provides. I'm struggling to find information on the following: My web application is supposed to be a long-lived page. After a time of inactivity, the browser may decide to put the tab to sleep, or my computer went into standby and is woken back up. Then the player seems to be broken. Making requests to the Web API that take a device ID, I get "502 Bad Gateway" responses (for the device ID I initially received via the "ready" listener). On the devices endpoint, that device ID is not listed.

My question is: How do I recover from that situation? I don't want to have to refresh the page. I cannot call disconnect() on the player, as that stalls. Calling connect() also stalls. Sometimes, connect() works, I receive the same device ID as before, but still get the 520 Bad Gateway responses. None of the official examples deal with this problem, and I also took a close look at implementations such as I didn't find anything that "repairs" a player instance.

Thanks for any advice!

1 Reply

This has been a problem since December 2023.  Spotify appears to be having some major CDN issues for developer targeted CDNs [I haven't seen this issue with other Spotify CDNs].  I've made a couple of posts about this topic but have received no response. 


Honesy, I've got a bad feeling about the future of the developer tools.

Suggested posts