2012-09-18 59 views
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会做?它只会播放一个音频或将使用户也看到该播放器?

回答

1

playbackManagerWillStartPlayingAudio只是告诉你噪音已经开始传递到扬声器/耳机/等。

CocoaLibSpotify不附带任何播放器UI。如果你想要这个,你必须自己构建它。