我想以2倍的速度在iPhone上播放视频

时间:2013-01-07 05:36:12

标签: iphone ios uiview mpmovieplayercontroller

我用MPMoviePlayerController来播放视频。但是没有方法/属性以2倍的速度播放视频。

还有其他方式以2倍速播放视频吗?

我用这种方法播放视频。

-(void)playMovie:(NSString *)fileName

{

NSLog(@" File name :: %@",fileName);

NSBundle *bundle = [NSBundle mainBundle];

NSString *moviePath = [bundle pathForResource:fileName ofType:@"mp4"];

NSLog(@"\n\n  moviePath :: %@",moviePath);

NSURL *url = [[NSURL fileURLWithPath:moviePath] retain];

moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

moviePlayer.controlStyle = MPMovieControlStyleDefault;

moviePlayer.shouldAutoplay = YES;

moviePlayer.view.frame = [[UIScreen mainScreen] applicationFrame];

[moviePlayer.view setFrame:playVideoView.bounds];

[playVideoView addSubview:moviePlayer.view];

[moviePlayer setFullscreen:YES animated:YES];

}

1 个答案:

答案 0 :(得分:3)

MPMoviePlayerController符合MPMediaPlayback protocol,其中包含以下属性:

@property(nonatomic) float currentPlaybackRate