我很高兴看到当“升级”到 Xcode 4.5 时,我的应用程序中的任何视频都无法播放。
通常我会这样做:
self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[self getBundleClip:@"theVideo"]];
self.moviePlayer.controlStyle = MPMovieControlStyleNone;
self.moviePlayer.shouldAutoplay = YES;
self.moviePlayer.repeatMode = MPMovieRepeatModeOne;
self.moviePlayer.view.frame = self.container.frame;
self.moviePlayer.view.userInteractionEnabled = NO;
[self.container addSubview:self.moviePlayer.view];
- (NSURL*)getBundleClip:(NSString*)clip
{
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:clip ofType:@"mp4"];
return [NSURL fileURLWithPath:moviePath];
}
同样,在我将 Xcode 更新到 4.5 之前,一切都运行良好。其他人有这个问题吗?
我也得到这个输出:
[MPAVController] Autoplay: Disabling autoplay for pause
[MPAVController] Autoplay: Disabling autoplay