2012-08-23 34 views

回答

6

建立在以下方式的MPMoviePlayerController對象會給你的視頻控件

yourMoviePlayerController = [MPMoviePlayerController new];  
yourMoviePlayerController.controlStyle=MPMovieControlStyleEmbedded; 
[yourMoviePlayerController setContentURL:[NSURL fileURLWithPath:videoPath]]; 
yourMoviePlayerController.backgroundView.hidden = YES; 

[yourMoviePlayerController setScalingMode:MPMovieScalingModeAspectFit]; 
yourMoviePlayerController.shouldAutoplay=YES; 
yourMoviePlayerController.movieSourceType = MPMovieSourceTypeFile; 
1

有人已經回答了這個問題here我覺得

設置controlStyle屬性MPMovieControlStyleNone最初的接口,然後設置它到MPMovieControlStyleFullscreen一秒鐘後使用[performSelector:withObject:afterDelay:1]。它運作良好,只有在用戶點擊視頻之後控件纔會出現。

相關問題