Мой 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];
Я пробовал этот фрагмент кода в другом контроллере представления с тем же результатом ошибки.
Я пробовал этот код фрагмента в новом проекте, и он отлично работает.
Что еще может вызвать эту ошибку?
Ответ здесь не разрешил для меня.