Listen for track ended event in Spotify iOS SDK -
i'm integrating spotify ios sdk app. how can listen track ending events on sptaudiostreamingcontroller
or spttrackplayer
?
i'm cool playing, pausing, authenticating, etc. need grab track-ended event.
i can see spttrackplayerdelegate
has methods, appropriately, trackplayer:didendplaybackoftrackatindex:ofprovider
,
but how can use these? there examples of usage?
thanks time!
these classes follow standard cocoa delegate pattern.
first, set delegate on track player:
self.trackplayer.delegate = self;
then implement delegate method in whatever self
is:
-(void)trackplayer:(spttrackplayer *)player didendplaybackoftrackatindex:(nsinteger)index ofprovider:(id<spttrackprovider>)provider { // track playback ended. }
your delegate method called track player when appropriate.
Comments
Post a Comment