ios-sdk
ios-sdk copied to clipboard
Suggestion: Enable/Disable AutoPlay
Hi guys
My team and I would love to enable / disable for our spotify-using application! Our Android Colleagues also mentioned this feature here: https://github.com/spotify/android-sdk/issues/90
Greetings
Any word on this? I would also find it very useful if auto-play after authentication could be disabled.
There was a bug that started playback when authentication was requested. This has been fixed in the latest version of Spotify. An SDK update is not needed.
However that won't let you control Spotify using AppRemote. Spotify on iOS needs to be playing music in order for the SDK to connect to it. So authorizeAndPlayURI
will always start playback.
@kkarayannis Thanks for your response but i think you misunterstood my question. If i talk about autoplay, i mean the automatic next playback after a track.
Example: I call the play() - method with a specific trackURI. After the track is finished, spotify will start another track, depending on the "radio" of the previous track. I would love to disable this behaviour. So if i "disable" AutoPlay, the playback would be paused after the first track, which i set, finished.
Greetings
Ok I understand your question now. There are no plans to enable something like this.
No plans ok. But will you accept Pull Requests on this? Best regard.
@patrice4github This would most likely need support from the Spotify app itself so making a change to this SDK wouldn't be enough.
But you can always just pause from your app using the SDK when the track changes. It should accomplish the same goal, right? @anscash
Right. I can't get the getPlayerState
callback to trigger either (I know there's an open issue about this already). I'll try to get it to fire in the demo app for now.
The Framework source isn't open ain't it. Or is it just me not finding it. Is it for a security reason?
@kkarayannis No it is not solution for us because the delay is too large.. You can listen the first ~ 0.5 second of the track before the pause action is done... :-(
No it's not open source. It's for legal reasons but I can't get any more specific than that.
Right now, I'm using appRemote as a requested scope with my SPTSessionManger to have access to using the player API from appRemote when I want to play a song on a certain screen in my app. Is there another way I can do this instead of through the appDelegate, so that the music doesn't automatically play when my app establishes connection with the Spotify app initially for authorization?
@alake16 Music needs to be playing for the SDK to connect to the app. That’s an iOS limitation.
I can connect to the app just fine. I'm now running the DemoApp on my phone.
I have created another button as well that calls playerAPI getPlayerState
. I cannot get the callback to fire no matter what I do.
I have committed my new button in a new branch. Pardon my inexperience, I can't seem to be able to create a PR. I'm asked to compare master with my branch (which I'm not authorized to push). Is there anything special I need to do to create a PR?
Pardon the previous noob comment, I have created a proper PR. The Demo app in the branch has a button that call playerAPI getPlayerState, and the callback never fires, whether the music is playing or not.
I have created a PR for this. I have tried everything there's to try, no matter what I do, the getPlayerState callback never triggers on my devices.
Is there any way to debug this? Best regards.
Are there work arounds for this? After a song ends, it triggers the radio. Is there a way to just play 1 track and stop? Repeat: off seems like it should do that, but instead the radio is on?
The only way is for the user to disable the Autoplay option in Settings -> Playback in the Spotify app.
Same question / problem here.
Radio / auto-play makes it hard to take total control over playback. Play one song with the SDK and the app will automatically pick and start a radio song right after it.
I am having some luck with a gross hack:
- play the first song you want and queue a silent track after that
- get the playerStateChange event and see that its the start of the silent track
- play the next song you want and queue a silent track after that
As long as you intercept the silent track, auto play / radio doesn't get triggered.
Only other thing I can think of is to use a timer to track the end of the playing track, then pause it and play the next one.