brim-borium / spotify_sdk

Flutter Package to connect the spotify sdk
https://pub.dev/packages/spotify_sdk
Apache License 2.0
143 stars 81 forks source link

Unable to add into Queue #128

Closed irfan-429 closed 2 years ago

irfan-429 commented 2 years ago

I'm trying to add tracks in the queue but it always gives an error.

Steps to reproduce the behavior:

Future<void> queue(String spotifyUri) async {
  try {
    await SpotifySdk.queue(spotifyUri: '$spotifyUri');
  } on PlatformException catch (e) {
    setStatus(e.code, message: e.details);
  } on MissingPluginException {
    setStatus('not implemented');
  }
}

Exception throwing

queueTrack failed with: error when adding uri: spotify:track:5tyMJlMqaggzvuX7TtlrTe to queue
com.spotify.protocol.client.error.RemoteClientException: {"message":"Cannot queue specified uri: [CANT_PLAY_ON_DEMAND]"}

Additional Details I'm already connect with Spotify.

irfan-429 commented 2 years ago

@brim-borium - Can you pls have a look into? Your help would be appreciated.

sidak003 commented 2 years ago

@irfan-429 I have tested this track on my project with both queue and play functions and it is working fine. Maybe, its some error with your spotify app or any kind of restriction as it says Can't play on Demand. Have you tested some other tracks with the same ?

irfan-429 commented 2 years ago

Yeah, I tried with many tracks. If I play individual track by passing it to play function it works. If I do same with queue it gives above error. If there is a problem with my connection then the individual play track should also not work. What do you think?

sidak003 commented 2 years ago

Are you using latest package/spotify app/.aar files ? If not then try after updating

irfan-429 commented 2 years ago

I'm using the latest but still same issue.

irfan-429 commented 2 years ago

@brim-borium - Did you get any chance to look into my issue please because only the plugin creator can know much about the error.

fotiDim commented 2 years ago

@irfan-429 are you using a free or Premium Spotify account?

irfan-429 commented 2 years ago

I'm using a free one.

fotiDim commented 2 years ago

Seems very similar to this. Please try with a Premium account and report back.

irfan-429 commented 2 years ago

This isn't a solid solution. Every end user couldn't have a premium spotify account. If this package requires premium account then what is the purpose of the package to add songs in queue? Why a person will use our app made by the help of this package if he requires a premium account. Not understandable solution!

fotiDim commented 2 years ago

@irfan-429 you do realize that we are not Spotify, right? This package can only do whatever the native SDK does. If this is a limitation of the native SDK there is nothing we can do. In that case you better open an issue on the native SDK repo.

fotiDim commented 2 years ago

Free accounts are not allowed to add tracks to the queue. Even the Spotify app works this way. Closing and please make sure you do some research before opening an issue.