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 in Chrome on Android (version 8 to ? <11) stops streaming after 10 seconds for all songs after initial song #101

Closed zzikkzzakk closed 2 years ago

zzikkzzakk commented 2 years ago

Describe the bug First of all: A great web player for Spotify. I integrated it in my project and it's working without problems on desktop browser (Chrome on Mac).

My main goal is to get it running on mobile, but it stops playing in Chrome on Android after 10 seconds for all songs after initial song. First I thought it's a problem in my project, but now I also tested it on the demo app https://react-spotify-web-playback.gilbarbara.dev/ and the same problem appears

To Reproduce Steps to reproduce the behavior:

  1. Go to https://react-spotify-web-playback.gilbarbara.dev/ on an Android phone and Chrome
  2. Submit a Spotify token
  3. Play a song for 30 seconds e.g. click on "Play an artist"
  4. Click to play next song
  5. The song stops streaming after 10 seconds, player still shows progress and switching to other devices the song can be listened to

Expected behavior All songs after initial one can be streamed via web playback in mobile browser

Codesandbox link (Required) Include a codesandbox will help us to investigate the issue quicker.

Template

Screenshots

Screenshot 2022-03-17 at 21 38 59

In the Screenshot you see the browser not continuing fetching audio after the first partial audio data for the second song.

Smartphone (please complete the following information):

Remark I would like to help investigating the issue and searched already on Spotify forums. As workaround I'm thinking of starting playback on the Spotify App (i.e. select it as playback device) instead in the Web browser, but this requires to redirect the user to open the App first when visiting my web page, which is quite confusing.

gilbarbara commented 2 years ago

hey @zzikkzzakk

This is just a wrapper on top of the Spotify Web Playback SDK, so most likely it is a problem in their SDK with the device/browser combo you mentioned.

gilbarbara commented 2 years ago

Are you sure isn't a problem with your specific device/OS/chrome? Android 8 reached end-of-life in December...

zzikkzzakk commented 2 years ago

@gilbarbara thanks for the quick feedback In fact I tested today on my girl-friends mobile with Android 11 and it works :) !!!! So that's relieving and a reason for me to get a new smartphone.

I will try to find smartphones with Android 9 and 10 to test the behaviour there. If anyone else can test on different Android versions would be great.

@gilbarbara do you think there is a way to reset the Spotify player? Because it's working for the first song, there seems to be some state maintained.

Besides I will consider the workaround to play on the Spotify App as device for older Android versions

gilbarbara commented 2 years ago

@zzikkzzakk

This library it's just a UI for their SDK and I don't plan to add code (and more surface for bugs and maintenance) to handle problems with unsupported devices.

Good luck!

zzikkzzakk commented 2 years ago

@gilbarbara : Sure, I understand. Thanks for the quick feedback though !