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

BUG: No player_state_changed event fired when seeking to position that matches last state #45

Open itsjustbrian opened 6 years ago

itsjustbrian commented 6 years ago

Issue found on September 2 2018.

Scope(s):

Chrome, Firefox

Steps to reproduce:

  1. Follow the quick start guide to make barebones web page that loads the player
  2. Use the normal Spotify application to connect to and control the player
  3. Play some song
  4. Wait a few seconds and then skip to the beginning of the track. Repeat as necessary until you stop getting player_state_changed events upon skipping (usually happens within 2 tries)
  5. Also possible to seek to the exact same position multiple times on the seek-bar to observe this. Just don't move your mouse, wait a few seconds, click, and repeat.

Expected behaviour:

player_state_changed should fire every time

Actual behaviour:

player_state_changed does not fire

The root cause is pretty easy to speculate on here. The behavior might have even been intentional, but would be a mistake IMO. In the above scenarios, the player state object that should have been fired by the event would be exactly the same as the last player state object received from player_state_changed. Taking step 4 from above as an example: the state you receive when first playing the song looks like { currentTrack: foo, position: 0, paused: false }, after waiting a few seconds and skipping to the beginning, the state would look exactly the same. I believe there's probably a check verifying some property of the player state has changed before firing player_state_changed, but not firing the event in this scenario is compromising to app logic. Any interaction with external controls for a player should fire the event regardless.

itsjustbrian commented 6 years ago

@arirawr I don't feel awesome about @mentioning people out of the blue but I filed this almost 2 months ago and it's a pretty substantial bug. Is the playback SDK still being maintained? Any update would be much appreciated.

Akim-Personal commented 5 years ago

Hi guys,

this seems to be still the case with the latest version. Is there any workaround this this? The player itself recognizes that it should start from the same old position again, so somehow it must get informed besides the player_state_changed event.

Kind regards