您的位置:首页 > 产品设计 > 产品经理

MPMoviePlayerViewController播放本地视频一直Loading问题

2015-06-19 15:40 711 查看
大致代码如下:
NSString *path = [[NSBundle mainBundle]pathForResource:@"7491.mp4" ofType:nil];
NSURL *contentURL = [NSURL URLWithPath:path];
NSLog(@"%@",contentURL);
if (contentURL) {
_player = nil;
self.player.moviePlayer.contentURL = contentURL;
[self presentMoviePlayerViewControllerAnimated:self.player];
}


问题出在URL上,这里的URL需要用+ (NSURL *)fileURLWithPath:(NSString *)path;创建,而不能用urlWithString

费了好久才找到原因
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: