【发布时间】:2012-10-08 17:25:51
【问题描述】:
我正在使用 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];
}
【问题讨论】:
标签: objective-c ios xcode mpmovieplayer