2013-01-07 75 views
-1

我用MPMoviePlayerController播放視頻。但是沒有方法/屬性以2x速度播放視頻。我想用iPhone播放視頻,速度爲2倍

是否有任何其他方式播放視頻在2x速度?

我用這種方法播放視頻。

-(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

看到這個http://stackoverflow.com/questions/9050631/playing-video-file-with-1- 5倍速2倍 – CRDave

+1

可能重複的問題http://stackoverflow.com/questions/10514185/play-forward-video-in-2x-3x-4x-speed-iphone-sdk –

回答

3

MPMoviePlayerController符合MPMediaPlaybackprotocol,它具有以下特性:

@property(nonatomic) float currentPlaybackRate 
+0

我可以通過這個控制器玩在線尖叫?我想以2倍速度在線播放mp4。 – northtree

+0

這將取決於流和網絡條件。 – farski