cocoalibspotify-2.0

Background Audio with cocoalibspotify

僤鯓⒐⒋嵵緔 提交于 2020-01-12 03:48:05
问题 I've properly enabled background audio for my app (in the plist). Playing the next track after the current is complete using SPPlaybackManager in the background (when the phone is locked/off) doesn't work. When the current track ends, and the audio stops, the app won't begin playing the next track until the phone is unlocked and my app becomes active again. How do I fix this? Here is a snippet of code I'm using to begin the playing of the next track. I observe that the current track becomes

Obtaining a lists of artists using cocoalibspotify for iOS

谁都会走 提交于 2019-12-19 10:49:13
问题 I'd like to quickly get a list of artist names in a user's "library" or playlists. Is there an easy / asynchronous way to do this? 回答1: Take a look at the example project "Guess the Intro" included with CocoaLibSpotify. The method waitAndFillTrackPool in that project shows how to get a list of all the tracks in the user's playlists. Once you have that list, you can do the following to get the artists from them, put them through a set to thin out duplicates, then wait until they're loaded.

CocoaLibSpotify playback crashes after a few seconds

守給你的承諾、 提交于 2019-12-13 02:48:34
问题 I followed the SimplePlayer example project while integrating it in my own test project. Logging in and searching for tracks already works perfectly, but when I try to play a song like SimplePlayer it crashes after 1-2 seconds of playback with EXC_BAD_ACCESS on two different locations in SPSession.m (see picture below). Here is the code that starts playback: SPTrack *track = [allTracks objectAtIndex:currentTrack]; [SPAsyncLoading waitUntilLoaded:track timeout:kSPAsyncLoadingDefaultTimeout

CocoaLibSpotify - Library not loaded

旧街凉风 提交于 2019-12-11 08:19:28
问题 I've created a simple mac app that uses the Cocoa wrapper for libspotify. When I export the project as an Application and try to run it, it crashes immediately. Crash report: Application Specific Information: dyld: launch, loading dependent libraries Dyld Error Message: Library not loaded: @rpath/CocoaLibSpotify.framework/Versions/A/CocoaLibSpotify Referenced from: /Users/USER/Desktop/Wunderkiste.app/Contents/MacOS/Wunderkiste Reason: image not found otool output: $ otool -L ~/Desktop

Offline playlists using CocoaLibSpotify

拈花ヽ惹草 提交于 2019-12-08 13:01:57
问题 I am using CocoaLibSpotify in an iOS application. When I set markedForOfflinePlayback to YES on an instance of SPPlaylist the offlineStatus almost immediately changes to SP_PLAYLIST_OFFLINE_STATUS_YES for the playlist and the tracks in the playlist. However, the offlineDownloadProgress is 0.0 all the time. The tracks have clearly not been cached. First and foremost, it would take much longer to cache them. Secondly, when I put my device in airplane mode and try to play one of the tracks

Spotify cocoalibspotify offline status set to 1 but all tracks stuck at waiting

旧街凉风 提交于 2019-12-08 08:34:43
问题 I'm trying to allow tracks from Spotify to be played offline in my iOS app. I've read several posts about this problem, but none of the suggestions work for me. The issue is a playlist marked for download gets stuck with all tracks "waiting" to be downloaded. I can recreate it regularly in a fresh app install by creating a playlist, adding a few tracks, and mark playlist for download. Tracks download as expected. Then I background the app by tapping the home button and kill the app in the app

Downloading cover art URL from Spotify and key-value observing

别说谁变了你拦得住时间么 提交于 2019-12-08 06:01:09
问题 I'm displaying a list of Spotify tracks in a table view in my application, and I'd like to download the cover art for the albums that these tracks belong to. I'm logged in to CocoaLibSpotify, and I can play all the tracks, so that part is fine. What I can't seem to get to work is the download of the cover art. I follow the code of the SimplePlayer project, with the exception that I store the SPTrack instances in a mutable dictionary (tracksDownladingForCoverArt), since there could be many

SPLoginViewController to remember credentials

六月ゝ 毕业季﹏ 提交于 2019-12-04 13:08:14
问题 In CocoaLibSpotify, how do I get SPLoginViewController to store credentials, so users later can login automatically via [[SPSession sharedSession] attemptLoginWithStoredCredentials:]? 回答1: You don't. Instead, implement the SPSessionDelegate method -session:didGenerateLoginCredentials:forUserName: and store the credentials in NSUserDefaults or whatever (the given credentials are already encrypted and safe for storing in cleartext). Next time your app launches, if you have available credentials

Background Audio with cocoalibspotify

蓝咒 提交于 2019-12-03 03:54:07
I've properly enabled background audio for my app (in the plist). Playing the next track after the current is complete using SPPlaybackManager in the background (when the phone is locked/off) doesn't work. When the current track ends, and the audio stops, the app won't begin playing the next track until the phone is unlocked and my app becomes active again. How do I fix this? Here is a snippet of code I'm using to begin the playing of the next track. I observe that the current track becomes nil, and then begin playing the next track. The log shows me that the next current track is being set in

Obtaining a lists of artists using cocoalibspotify for iOS

房东的猫 提交于 2019-12-01 13:35:44
I'd like to quickly get a list of artist names in a user's "library" or playlists. Is there an easy / asynchronous way to do this? Take a look at the example project "Guess the Intro" included with CocoaLibSpotify. The method waitAndFillTrackPool in that project shows how to get a list of all the tracks in the user's playlists. Once you have that list, you can do the following to get the artists from them, put them through a set to thin out duplicates, then wait until they're loaded. NSArray *artists = [theTrackPool valueForKeyPath:@"@unionOfArrays.artists"]; NSArray *uniqueArtists = [[NSSet