Skip to content
This repository has been archived by the owner on Jul 4, 2020. It is now read-only.

https://api.spotify.com/v1/me/player/play doesn't play the specific spotify track_id #631

Closed
cagriar opened this issue Aug 2, 2017 · 24 comments

Comments

@cagriar
Copy link

cagriar commented Aug 2, 2017

Issue found on August 2nd, 2017.

Endpoint(s):

  • PUT https://api.spotify.com/v1/me/player/play

Scope(s):

  • user-modify-playback-state

Steps to reproduce:

  1. Open the API Console
  2. Call the playback/play endpoint with device_id and uris body field as:
    { "uris": [ "spotify:track:2LlvrdnLa3XbB1b4jYuCnl" ] }

Expected behaviour:

The spotify song with the provided track id specified in the uris field will be started playing on the user device with the id device_id. A successful request will return a 204 NO CONTENT response code.

Actual behaviour:

I get 204 NO CONTENT response but the playback of the user device do not change to the song with the track id provided.

@BasKiers
Copy link

BasKiers commented Aug 2, 2017

I also experience this issue.

If I do the following request in the api console here
Device ID: "ID of the device mentioned below"
PUT Body: { "uris": ["spotify:track:0z8yrlXSjnI29Rv30RssNI"] }

I experience the following:
It does not play anything when using the device id of my Amazon Echo Dot (2nd Generation)
It works when I use the device id of my OSX Spotify client
It works when I use the device id of a Chromecast v2
It works when I use the device id of my Samsung Galaxy S7

The same happens when I do not provide a Device ID and the tested speaker is already the active speaker.

Edit: When using the default PUT Body from the console using the "context_uri" parameter the request does work for the Amazon Echo Dot

Device ID: "ID of Echo Dot"
Put Body: { "context_uri": "spotify:album:5ht7ItJgpBH7W6vJ5BqpPr", "offset": { "position": 5 } }

@tjschutte
Copy link

+1 Same issue. For me it is able to play music on device (start playback of what ever song/playlist was previously paused) but not start playback of a sent track.

@WeeJeWel
Copy link

WeeJeWel commented Aug 5, 2017

+1 Also happens here on an Echo Dot or Denon Heos.

@happyruss
Copy link

+1
calling with a uri list will start playing the player, but will not play the song i sent in either the body or the data field. It seems like the uri array is getting ignored. Do spotify API calls expect these values to be in the "body" or the "data" or some other node?

@casperboone
Copy link

casperboone commented Sep 3, 2017

+1

However, only experiencing this issue on connect speakers. When I try to play a track on my Macbook (desktop client), everything works fine.

Side note: using a context_uri instead of track uris does seem to work fine on connect speakers.

@cosinekitty
Copy link

+1

I am experiencing the same issue with player/play directed at a Spotify Connect device. My PUT request receives a 204 status as expected, but there is no playback. The device receives two consecutive FLUSH commands followed by nothing else: no metadata, no play command, no audio data.

More details:
I have tried sending two different commands: TransferPlayback followed by StartPlayback. Both return status code 204.

https://api.spotify.com/v1/me/player
{"device_ids":["3888c7eaa9d20e71b9a84f58718127d2db4a0ef0"],"play":true}
https://api.spotify.com/v1/me/player/play
{"uris":["spotify:track:7mYUeJq8M8S8kzDZUs6o23"],"offset":{"position":0}}

If I send the first PUT request only, it correctly transfers playback to the selected Spotify Connect device. Whatever I was playing on my phone starts playing on that speaker. So I know I have the correct bearer access token in my request header, etc.

If I also send the next command to try to play a specific track, everything stops: two FLUSH commands, no audio, as described above.

Any help getting this working would be appreciated!

@AndertonNBackup
Copy link

+1
Experiencing the issue whenever I try to initiate playing a new track on any connect device.
All is working fine if I send the command to my laptop or even my iPhone. However, I have tested with Alexa on an Amazon Dot and on an Amazon Fire Stick and both refuse to play despite returning a valid 204 status code. The same command works flawlessly when sent to the iPhone or laptop.
If I start a playlist running and then simply transfer the audio to one of the connect devices I have no issue and the playback resumes on the new device as expected.

Fix or a work around desperately needed please!

@gawen
Copy link

gawen commented Sep 11, 2017

+1

Same issue. Playing a simple track does not work anymore.

The returned value from the server is 204 yet the track is not played.

$ curl \
   -D - \
   -X PUT "https://api.spotify.com/v1/me/player/play" \
   -H "Accept: application/json" \
   -H "Authorization: Bearer FOO" \
   -H "Content-Type: application/json" \
   --data "{\"uris\":[\"spotify:track:4iV5W9uYEdYUVa79Axb7Rh\"]}"

HTTP/2 204 
server: nginx
date: Mon, 11 Sep 2017 09:31:56 GMT
cache-control: private, max-age=0
access-control-allow-origin: *
access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
access-control-allow-credentials: true
access-control-max-age: 604800
access-control-allow-headers: Accept, Authorization, Origin, Content-Type
x-content-type-options: nosniff
strict-transport-security: max-age=31536000;

Work around desperately needed too!

@gawen
Copy link

gawen commented Sep 11, 2017

It is currently working: my previous command works (with the right Bearer of course). Is this solved?

@WeeJeWel
Copy link

Still not working on an Amazon Echo. The speaker gets marked 'active' but the track doesn't switch. The progressbar (in the desktop app) shows progress yet nothing can be heard.

@casperboone
Copy link

casperboone commented Sep 11, 2017

@gawen Think you were just lucky, doesn't seem to work yet ;).

Small addition to @WeeJeWel's comment: The track doesn't switch, but also the track that was previously playing is started over (but without sound, it's silent).

@rlingineni
Copy link

+1 Unexpected behavior with Echo Dot and playing tracks. Sending the track id of an already playing track resumes playback and doesnt start it over again.

@AndertonNBackup
Copy link

Guys, is this likely to be accepted as a bug? It's been quite some time now without any response and is clearly affecting many of us.
Could we possibly have some feedback please as this is a show stopper for me at least.
Many Thanks!

@WeeJeWel
Copy link

I can imagine its a bug in the embedded spotify connect library on those devices, which makes fixing them require an update from those vendors.

Yet still a heads-up and possibly ETA would be nice.

@arirawr
Copy link

arirawr commented Oct 18, 2017

Hi folks,

Thanks for reporting these issues. We're looking into them.

@cagriar, which market are you in? It seems the track you mentioned may not be available in the US. Try applying Track Relinking first, or try your request with track id 2AT8iROs4FQueDv2c8q2KE instead.

For those experiencing problems on specific devices, we are aware of issues using the Connect API with certain devices and are working to fix it. We will post here with updates.

@cagriar
Copy link
Author

cagriar commented Oct 19, 2017

Hi @arirawr,

I am trying to control a Spotify account registered in Turkish market. I'm quite sure that the track I want to play is available in Turkish market as well. Plus, I can get the track info by using GET track request successfully. So it means its available in Turkish market, right? Do you think that I still need track relinking?

@cagriar cagriar closed this as completed Oct 19, 2017
@cagriar cagriar reopened this Oct 19, 2017
@cagriar
Copy link
Author

cagriar commented Oct 19, 2017

Hi @arirawr,

When I dig deep into track relinking, I have realised that the actual track id that Spotify suggested is the one you have provided in your message. But when I tried to play that track on my Spotify device, it still didn't work. So I re-opened the issue.

@arirawr
Copy link

arirawr commented Oct 19, 2017

@cagriar Good to know. What type of device are you trying to play on?

@cagriar
Copy link
Author

cagriar commented Oct 20, 2017

@arirawr It's a device we are implementing that has Spotify hardware partnership.

@arirawr
Copy link

arirawr commented Oct 20, 2017

Alright, sounds like you may be having the same issue as the other folks with hardware devices then. We'll be sure to post when we have updates on this!

@cagriar
Copy link
Author

cagriar commented Oct 20, 2017

@arirawr The problem seems solved right now. I am waiting for your updates to close this one.

@WeeJeWel
Copy link

I can verify it works on Amazon Echo. I will try Denon Heos as well, thank you so much!

@AndertonNBackup
Copy link

Verified on Echo Dot and FireTV Stick. Many thanks guys, very much appreciated!

@cagriar
Copy link
Author

cagriar commented Oct 25, 2017

Thanks, closing the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests