ios – MPMoviePlayerController 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

我的代码是调用MPMoviePlayerController的沼泽标准方法:

在.h文件中:

@property (retain) MPMoviePlayerController *videoPlayer;

在.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];

我已经尝试这个代码片段在不同的视图控制器中具有相同的错误结果.

我已经在一个新的项目中尝试了这段代码,它的工作正常.

还有什么可能导致这个错误?

答案here没有为我解决.

解决方法

解决方案:从断点选项卡中删除“所有异常”. 这个答案来自Till的评论.我有这个问题,我几乎错过了答案,因为它是一个评论.直到答案帮助我,所以我希望这有助于别人像我一样.

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...