gilbarbara / react-spotify-web-playback

A simple player for Spotify's web playback
https://react-spotify-web-playback.gilbarbara.dev/
MIT License
324 stars 70 forks source link

Play issue on changedURIs #97

Closed sbereghici closed 2 years ago

sbereghici commented 2 years ago

Describe the bug If you pause the current playing song, then change the uris, the player continues to play the previous song, not the expected one

To Reproduce Steps to reproduce the behavior:

  1. Go to your demo
  2. Click on 'Play an artist'
  3. Click on 'Pause' from player
  4. Click on 'Play an album'

Expected behavior The song you expect to play, will not play

Additional context The quick fix will be to remove the isPlaying clause from index.tsx:188 const shouldPlay = (changedURIs && isPlaying) || !!(isReady && (autoPlay || playProp)); -> const shouldPlay = changedURIs || !!(isReady && (autoPlay || playProp));

gilbarbara commented 2 years ago

hey @sbereghici

I couldn't reproduce this behavior with the above steps.

2022-01-31 09 42 49

sbereghici commented 2 years ago

Well, pretty strange ... CPT2201311547-760x348

gilbarbara commented 2 years ago

Which browser and version? Can you test in an incognito window to make sure it's not some interference from extensions and/or scripts?

sbereghici commented 2 years ago

Which browser and version? Can you test in an incognito window to make sure it's not some interference from extensions and/or scripts?

Chrome v97.0.4692.99 ... I've tried in incognito and it works the same way, playing the old song, also tried with Edge, same result.

gilbarbara commented 2 years ago

Are you using this url or the demo inside the codesandbox? The Web Playback SDK has some issues with iframes

sbereghici commented 2 years ago

Are you using this url or the demo inside the codesandbox? The Web Playback SDK has some issues with iframes

Hey @gilbarbara, I'm using the url.

gilbarbara commented 2 years ago

Couldn't replicate this behavior.