2012-08-07 89 views
0

对于我的应用程序,我使用的是MPMoviePlayerController。问题是我该如何检测下一个和上一个按钮事件。因为在MPMoviePlayerController我们可以检测到各种事件,但我无法找到任何方法来检测下一个和上一个按钮事件。我使用的用于检测其他事件中的代码是检测MPMoviePlayerController中的下一个和上一个按钮事件

- (void)moviePlayerPlaybackStateChanged:(NSNotification *)notification { 
MPMoviePlayerController *moviePlayer = notification.object; 
MPMoviePlaybackState playbackState = moviePlayer.playbackState; 
switch (playbackState) { 
    case MPMoviePlaybackStateStopped: 
     NSLog(@"stop"); 
     break; 
    case MPMoviePlaybackStatePlaying: 
     NSLog(@"playing"); 
     break; 
    case MPMoviePlaybackStatePaused: 
     NSLog(@"paused"); 
     break; 
    case MPMoviePlaybackStateInterrupted: 
     NSLog(@"Interrupted"); 
     break; 
    case MPMoviePlaybackStateSeekingForward: 
     NSLog(@"forward"); 
     break; 
    case MPMoviePlaybackStateSeekingBackward: 
     NSLog(@"backword"); 
     break; 
    default: 
     break; 
} 

}

我需要这个,因为我想在一个播放列表播放一个和下一个曲目。

+0

你需要在外部为下一个和上一个事件添加按钮 – 2012-08-07 09:08:04

+0

但我已经看到一个应用程序在iTunes上完成同样的事情,而不需要在外部添加按钮。 – 2012-08-07 09:21:55

回答

0

没有userInfo字典对于MPMoviePlayerPlaybackStateDidChangeNotification。

相关问题