开发者社区> 问答> 正文

为什么ios 视频播放器播放不了

NSString *path = [[NSBundle mainBundle] pathForResource:@"1" ofType:@"mp4"];
NSURL *url = [NSURL fileURLWithPath:path];
MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:url];
[mp.view setFrame:CGRectMake(0, 0, 320, 200)];
[mp.view setBackgroundColor:[UIColor redColor]];
[self.view addSubview:mp.view];
[mp play];

错误原因:`2014-08-04 11:43:48.371 JiaJS01[3183:90b] Cannot find executable for CFBundle 0x10c037500 (not loaded)
2014-08-04 11:43:48.387 JiaJS01[3183:90b] Cannot find executable for CFBundle 0x10c13c4a0 (not loaded)`
在网上搜索的方法还原模拟器不可用,还原过后依然是报这个错误

展开
收起
爵霸 2016-03-17 09:39:49 4047 0
1 条回答
写回答
取消 提交回答
  • MPMoviePlayerController 应该先将它变为属性,不然会黑屏

    2019-07-17 19:04:31
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
手淘iOS性能优化探索 立即下载
From Java/Android to Swift iOS 立即下载
深入剖析iOS性能优化 立即下载