spotify / web-api

This issue tracker is no longer used. Join us in the Spotify for Developers forum for support with the Spotify Web API ➡️ https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
983 stars 79 forks source link

Play endpoint should be aware of crossfade #1162

Open TLmaK0 opened 5 years ago

TLmaK0 commented 5 years ago

Issue found on February 15th 2019.

Endpoint(s):

Scope(s):

Steps to reproduce:

  1. Open the API Console
  2. Call the Start/Resume a User's Playback endpoint with "offset": {"uri": "spotify:track:1301WleyT98MSxVHPZCA6M"}

Expected behavior:

Spotify player starts the track with crossfade if its playing a song and crossfade option it's activated in player.

Actual behavior:

Player stops current song abruptly although crossfade it's active and starts the new one.

Suggestion

Add an option to the endpoint "respect_crossfade" to maintain compatibility for old integrations

jscholes commented 5 years ago

Crossfading only happens between the end of one song and the beginning of another, not for manual transitions between tracks. If you enable the crossfade option in the mobile or desktop app, start playback of one song and then manually switch playback to another, the two won't crossfade. So if this was implemented, it would be nonstandard behaviour.

TLmaK0 commented 5 years ago

Thanks @jscholes to help me to remember how spotify works. This is more a feature request than a issue, but I don't have enough permissions to label it. I know that this feature has been requested several times #791 and #15 . I'm asking for it because I have an use case for this. If you are trying to play music in different order than spotify playlist you are not able to modify it on real time, your able only to play a selected track at the end of the other, this is why I need crossfade when I call "play".

jscholes commented 5 years ago

Spotify don't currently offer third party developers the ability to track when songs end in realtime (or any other realtime playback events) unless you're using the Web Playback SDK. But to my knowledge that SDK doesn't support crossfading anyway. If you're using a private, undocumented API to track playback events in realtime, then Spotify are unlikely to grant a feature request based on that usage. Could you expand on how your application is detecting when songs come to an end?

There is another issue with what you're asking for. The Spotify apps allow the crossfade duration to be configured by the user (up to 12 seconds in length). Assuming you do have a method for tracking song playback in realtime which is supported by Spotify (e.g. you're an official Spotify partner), does the stop event fire at the start of the crossfade duration, or at the end? If the Spotify application doesn't know that another song will be played after the current one, will it even begin a fade out of the currently-playing track at all?

IMHO this would be the wrong solution to your problem. Once Spotify provide a way for third party apps to manage the playback queue, you'll have what you need. It seems unlikely that they'll implement this first, if at all.

TLmaK0 commented 5 years ago

thanks @jscholes let spotify devs to respond to my request. There are a lot of ways to know when the song will end with the current api.