Web Playback SDK lifecycle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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 https://github.com/y-hiraoka/react-spotify-web-playback-sdk. I didn't find anything that "repairs" a player instance.
Thanks for any advice!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page