Announcements
The Spotify Stars Program: Celebrating Values Week!

Help Wizard

Step 1

NEXT STEP

player_state_changed event with wrong duration

player_state_changed event with wrong duration

I have a problem with the player_state_changed event and I need help. My React application makes use of Spotify Web Playback SDK to play songs, but when I skip a song the player_state_changed event is triggered multiple times with some inconsistencies:

WObject = WebPlaybackState Object

1st event: I can get data such as name and artists with the correct values, but in WObject and WObject > track_window > current_track the duration property appears with the value of the previous song.

2nd event: The duration appears with a value about 24ms less than the correct one.

3rd event: All values are correct.

What is happening?
Reply
2 Replies

I have the same problem. By verifying with the local state and the previous track we can make it somewhat work but would be great if this could be corrected :+1

Same issue here. And it was already opened in the old issue tracker here: https://github.com/spotify/web-playback-sdk/issues/115

Suggested posts