Here is the code for Forward and BackWard Movie as 2x 3x 4x for MPMoviePlayerViewController
In the .h file
@property(nonatomic) float currentPlaybackRate;
In the .m File
- (void)viewDidLoad { currentPlaybackRate=1.0;
Now about the actions of the FastForward and FastBackward buttons
[fastForward addTarget:self action:@selector(fastForward) forControlEvents:UIControlEventTouchUpInside]; [fastBackWard addTarget:self action:@selector(fastBackward) forControlEvents:UIControlEventTouchUpInside];
Action code
-(void)fastForward { [mp.moviePlayer pause]; playPauseButton.selected=TRUE; if (currentPlaybackRate < 0.0) { currentPlaybackRate = 1.0; } if (currentPlaybackRate < 4.0) { currentPlaybackRate=currentPlaybackRate+1.0; NSLog(@"Forward::%f",currentPlaybackRate); mp.moviePlayer.currentPlaybackRate=currentPlaybackRate; } } -(void)fastBackward { [mp.moviePlayer pause]; playPauseButton.selected=TRUE; if (currentPlaybackRate > 0.0) { currentPlaybackRate = 0.0; } if (currentPlaybackRate > -4.0) { currentPlaybackRate=currentPlaybackRate-1.0; NSLog(@"BackWard::%f",currentPlaybackRate); mp.moviePlayer.currentPlaybackRate=currentPlaybackRate; } }
source share