I'm using SPPlaybackManager to play tracks, but am having a difficult time with some small but important aspects of playback. Tracks are loading and streaming, but often begin playing .25 - 1.25 seconds after the callback function of SPAsyncLoading is called. I've tried a number of methods to see when the track really starts playing but all seem to indicate playback has initiated the moment the SPAsyncLoading callback is called (including playbackManager.isPlaying, playbackManager.currentTrack, etc). I determined that playback actually begins after the brief latency I mentioned before by setting an NSTimer to run for 10 seconds upon the SPAsyncLoading callback, getting playbackManager.trackPosition after the 10 seconds and finding the difference. TL;DR - the playback doesn't actually start when CocoaLibSpotify says it starts.
A few problems arise because of this: first and most importantly, the song gets chopped off at the end by whatever offset existed between callback and playback initially. Second, from a UX perspective, I need to be able to indicate to my users that they're in the "dead space" between SPAsyncLoading callback and actual playback (i.e. that the track is preparing to play, but not yet playing). Any recommendations on ways to circumvent or solve these problems much appreciated!