Help Wizard

Step 1

NEXT STEP

Refresh API

Refresh API

Hey,


So I am making a little project, where basically, I get user's current details, along with  the ability to control it over the web with Web Playback SDK and Web API, although, I don't get one thing. As the Web Playback SDK is basically registering the device and yet, once start the playback on it. After refreshing the page of course the device is unregistered and I do understand that, but what can I do in order to refresh specific details on the page without refreshing the page itself.
I am using jwilsson's Spotify Web API PHP, but unfortunately, I have no idea how to achieve this. 

First of all, once I load the page, after a couple of seconds, the device, aka browser gets registered and I can start streaming the music into it. (It works in Firefox only for some reason, not in Chrome or Edge Chromium)

 

EKkh99O

 

Could I somehow specific details like current song, device name, volume without updating the whole page itself?

Would I need to use Ajax/jQuery or a different method to update details?

 

 

Reply
2 Replies

Hi @sqpp! It's great to hear that you're trying out the Web Playback SDK. Yes, your app can fetch the track title, volume, and device state with client-side JavaScript using these methods:
Spotify.Player#getVolume

Spotify.Player#getCurrentState

Thanks, unfortunately, Web Playback SDK does not work in Edge Chromium at all.

Suggested posts