我正在使用 MpMovieplayer 在 ios 5 中动态播放 mov 文件(从设备中选择视频),但它没有播放。它显示黑屏。我也尝试直接将电影 url 提供给播放器,但它不起作用。有没有播放器而不是MPMovieplayer 播放 mov 文件。在此先感谢
NSString *path = [[NSBundle mainBundle] pathForResource:@"Movie" ofType:@"mov"];
NSURL *movieURL = [NSURL fileURLWithPath:path];
NSLog(@"movieURL ----%@",movieURL);
movieplayer=[[MPMoviePlayerController alloc] initWithContentURL:movieURL];
if([movieplayer respondsToSelector:@selector(view)])
{
movieplayer.controlStyle = MPMovieControlStyleFullscreen;
[movieplayer.view setFrame:self.view.bounds];
[self.view addSubview:movieplayer.view];
movieplayer.shouldAutoplay=true;
[movieplayer play];
}