I am developing an iPhone application where I need to reverse a video playback. I am currently using XCode 4.2. I am trying to play a movie in reverse with the MPMoviePlayerController. But when it plays in reverse it is not as smooth as playing it forward. It becomes a bit choppy and is not at all smooth. The following is my code.
- (void)viewDidLoad{
//code for initializing the movie player
MPMoviePlayerController videoPlayer =
[[MPMoviePlayerController alloc] initWithContentURL:"URL"];
self.videoPlayer = videoPlayer;
[videoPlayer release];
self.videoPlayer.view.userInteractionEnabled = NO;
self.videoPlayer.initialPlaybackTime = -1;
self.videoPlayer.shouldAutoplay=NO;
[self.videoPlayer prepareToPlay];
//code for initializing the button
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitle:@"Reverse" forState:UIControlStateNormal];
[button addTarget:self
action:@selector(reverseMovie) forControlEvents:UIControlEventTouchDown];
button.frame = CGRectMake(0, 0, 50, 40);
[self.view addSubview:button];
}
-(void)reverseMovie{
[self.videoPlayer setCurrentPlaybackRate:-1.0];
}
如何解决这一问题?