检测MPMoviePlayerController中的下一个和上一个按钮事件

时间:2012-08-07 08:40:31

标签: iphone objective-c 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;
}

}

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

1 个答案:

答案 0 :(得分:0)

MPMoviePlayerPlaybackStateDidChangeNotification没有userInfo字典。