我正在使用MPMoviePlayerController播放视频。 但是当我点击下一个和上一个按钮时,它会关闭视图。 我已经看过使用NSNotification实现它的教程。 但我仍然无法进入下一个和上一个视频 这是我的应用程序的代码
moviePlayer =
[[MPMoviePlayerController alloc] initWithContentURL:movieURL];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playbackChanged)
name:MPMoviePlayerPlaybackStateDidChangeNotification object:moviePlayer];
- (void)playbackChanged {
moviePlayer = notification.object;
switch ([moviePlayer playbackState])
{
case MPMoviePlaybackStateStopped:
NSLog(@"Stopped");
break;
case MPMoviePlaybackStatePlaying:
NSLog(@"Playing");
break;
case MPMoviePlaybackStatePaused:
NSLog(@"Paused");
break;
case MPMoviePlaybackStateInterrupted:
NSLog(@"Interrupted");
break;
case MPMoviePlaybackStateSeekingForward:
NSLog(@"Seeking Forward");
break;
case MPMoviePlaybackStateSeekingBackward:
NSLog(@"Seeking Backward");
break;
default:
break;
}
}