MPMoviePlayerViewController - 听到声音,但没有看到视频

时间:2012-03-31 11:12:53

标签: xcode

QuickTime播放器显示在我的View Controller图层上,视频文件“Happy”完全播放,但没有视频显示。只听到音频。完成后,QuickTime播放器将按原样转换回上一个View Controller。

NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Happy" ofType:@"m4v"]];
MPMoviePlayerViewController * playerController = [[MPMoviePlayerViewController alloc] initWithContentURL:url];               
[self presentMoviePlayerViewControllerAnimated:playerController];
playerController.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
playerController.moviePlayer.controlStyle = MPMovieControlStyleNone; 
[playerController.moviePlayer play];
[playerController release];
playerController=nil; 

1 个答案:

答案 0 :(得分:0)

据我所知,我们无法播放m4v文件。将其转换为mp4