1
目前我可以播放spotify曲目。我能聽音樂。但是,如果我想打開一個音頻播放器,就像Spotify一樣,&想要聽到播放器的控制按鈕嗎? 我的代碼放在這裏:Spotify開放音頻播放器
// Invoked by clicking the Cell in the UI.
// arrfileteredURL -> list of track urls
NSURL *trackURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@",[arrfileteredURL objectAtIndex:indexPath.row]]];
NSLog(@"trackURL > %@",trackURL);
[[SPSession sharedSession] trackForURL:trackURL callback:^(SPTrack *track)
{
if (track != nil)
{
[SPAsyncLoading waitUntilLoaded:track timeout:kSPAsyncLoadingDefaultTimeout then:^(NSArray *tracks, NSArray *notLoadedTracks)
{
[self.playbackManager playTrack:track callback:^(NSError *error)
{
if (error)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Cannot Play Track" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
} else
{
}
}];
}];
}
}];
什麼playbackManagerWillStartPlayingAudio會做?它只會播放一個音頻或將使用戶也看到該播放器?