Ala*_*lan 15 xcode mpmovieplayercontroller ios ios-simulator
当我尝试播放任何视频时,我的MPMoviePlayerController崩溃了.
这只发生在模拟器上,在设备上正常工作.
错误如下:
2012-10-25 16:46:24.033 TheFasterChef[8529:14303] [MPAVController] Autoplay: Disabling autoplay for pause
2012-10-25 16:46:24.035 TheFasterChef[8529:14303] [MPAVController] Autoplay: Disabling autoplay
2012-10-25 16:46:24.172 TheFasterChef[8529:14303] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 0)
2012-10-25 16:46:24.190 TheFasterChef[8529:14303] [MPAVController] Autoplay: Enabling autoplay
2012-10-25 16:46:24.227 TheFasterChef[8529:14303] [MPAVController] Autoplay: Likely to keep up or full buffer: 0
2012-10-25 16:46:24.227 TheFasterChef[8529:14303] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
2012-10-25 16:46:24.232 TheFasterChef[8529:14303] [MPAVController] Autoplay: Enabling autoplay
2012-10-25 16:46:24.238 TheFasterChef[8529:14303] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
Run Code Online (Sandbox Code Playgroud)
我的代码是调用MPMoviePlayerController的bog标准方法:
在.h文件中:
@property (retain) MPMoviePlayerController *videoPlayer;
Run Code Online (Sandbox Code Playgroud)
在.m文件中:
NSBundle *appBundle = [NSBundle mainBundle];
//NSString *contentURLString = [appBundle pathForResource:videoIdentifier ofType:@"mp4"];
NSString *contentURLString = [appBundle pathForResource:@"test" ofType:@".mp4"];
NSURL *contentURL = [NSURL fileURLWithPath:contentURLString];
self.videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:contentURL];
[self.videoPlayer prepareToPlay];
[self.videoPlayer.view setFrame: self.view.bounds];
[self.view addSubview:self.videoPlayer.view];
[self.videoPlayer prepareToPlay];
[self.videoPlayer play];
Run Code Online (Sandbox Code Playgroud)
我在不同的视图控制器中尝试了这段代码,但错误结果相同.
我在一个新项目中尝试了这个代码片段,它运行正常.
还有什么可能导致此错误?
这里的答案并没有为我解决.
Raw*_*ean 57
解决方案:从断点选项卡中删除"所有异常".
这个答案来自Till上面的评论.我有这个问题,我几乎错过了答案,因为这是一个评论.直到我的回答帮助了我,所以我希望这能帮助像我这样的其他人.

你自己给出了答案.这纯粹是一个模拟器问题.通常,与媒体相关的API在设备上运行得更好(有时候).
| 归档时间: |
|
| 查看次数: |
4889 次 |
| 最近记录: |