Spotify Open Audio Player

时间:2012-09-18 06:21:25

标签: iphone ios4 cocoalibspotify-2.0

目前我可以播放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 个答案:

答案 0 :(得分:1)

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

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