MPMoviePlayerViewController不为IOS 8.4播放video

我的video播放IOS 8.3和更早版本。 但最近IOS 8.4video播放器更新后停止工作。 video不会播放,并立即进入MPMoviePlaybackComplete:方法。

Here is my code : self.player = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL]; [self.player.moviePlayer setFullscreen:YES animated:YES]; if(subtitlesPathStr){ [self.player.moviePlayer openSRTFileAtPath:subtitlesPathStr completion:^(BOOL finished) { // Activate subtitles [self.player.moviePlayer showSubtitles]; [self.navigationController presentMoviePlayerViewControllerAnimated:self.player]; } failure:^(NSError *error) { NSLog(@"Error: %@", error.description); } ]; }else [self.navigationController presentMoviePlayerViewControllerAnimated:self.player]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MPMoviePlayerLoadStateDidChange:) name:MPMoviePlayerLoadStateDidChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MPMoviePlayerDidEnterFullscreenNotification:) name:MPMoviePlayerDidEnterFullscreenNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MPMoviePlaybackComplete:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; 

有人可以告诉我如何解决这个问题?

根据播放时间和播放时间添加您的重置video方法。

  - (void)playbackDidFinish:(NSNotification*)aNotification { MPMoviePlayerController *moviePlayer = aNotification.object; NSNumber *reason = [aNotification.userInfo objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey]; if ([reason intValue] == MPMovieFinishReasonPlaybackEnded) { if (moviePlayer.currentPlaybackTime == moviePlayer.playableDuration) { [moviePlayer stop]; } } }