ビデオの再生を逆にする必要があるiPhoneアプリケーションを開発しています。私は現在XCode4.2を使用しています。MPMoviePlayerControllerで映画を逆再生しようとしています。ただし、逆方向に再生すると、順方向に再生するほどスムーズではありません。少し途切れ途切れになり、なめらかではありません。以下は私のコードです。
- (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];
}
これに対する可能な解決策は何でしょうか?