我在使用 MPMoviePlayerController 时遇到问题。它在 ios 5 中不起作用,只是显示一个黑屏。甚至没有抛出任何异常或任何错误。这是我的代码:
NSString *path = [[NSBundle mainBundle] pathForResource:@"cavity" ofType:@"mov"];
NSLog(@"%@",path);
_movieController = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:path]];
[_movieController prepareToPlay];
[_movieController setFullscreen:NO];
[_movieController.view setFrame:CGRectMake(10, 25, 287, 213)];
[_movieController setControlStyle:MPMovieControlStyleEmbedded];
[_movieView addSubview:_movieController.view];
[_movieController play];
_movieController 对象已在 .h 文件中声明,但仍未处于工作状态。