目前我可以播放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
{
}
}];
}];
}
}];
playManagerWillStartPlayingAudio 会做什么?它只会播放音频还是让用户也能看到播放器?