user379468
user379468

Reputation: 4039

Cocoalibspotify, how to trigger an action when playlist plays the next track

I have a playlist, and I want to sequentially play through the tracks, but every time a new track is loaded, I want to call a function. How would I go about listening for this event?

Upvotes: 0

Views: 226

Answers (1)

iKenndac
iKenndac

Reputation: 18776

SPPlaybackManager, the playback class in CocoaLibSpotify, doesn't automatically play tracks sequentially, so you have to manually tell it to play each time. Since you're managing that, you already know when a new track is starting playback.

Additionally, SPPlaybackManagerDelegate has a method -playbackManagerWillStartPlayingAudio:, which will let you know when audio starts hitting the speakers.

Upvotes: 1

Related Questions