MPMoviePlayerController无尽的加载

时间:2013-07-05 19:30:39

标签: iphone mpmovieplayercontroller

我正在尝试使用MPMoviePlayerController播放MP4文件(也试过两个m4v文件,同样的问题),最后让视频播放器出现,但它只是保持加载状态。这是我的代码,按下按钮执行:

NSString *videoFile = [[NSBundle mainBundle] pathForResource:@"attn8" ofType:@"mp4" inDirectory:@""];
NSURL *url = [NSURL fileURLWithPath:videoFile isDirectory:NO];
player = [[MPMoviePlayerController alloc] initWithContentURL:url];

player.movieSourceType = MPMovieSourceTypeFile;
//put on a whim from another answer, made no difference

[self.view addSubview:[player view]];
player.fullscreen = true;
[player prepareToPlay];
[player play];

0 个答案:

没有答案