我正在尝试使用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];