可以实现通知技术来处理它。添加一个通知,并在所在班级电影播放器正在播放并与它关联一个选择器以再委托方法
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
UIApplication *app = [UIApplication sharedApplication];
UIBackgroundTaskIdentifier bgTask = 0;
bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
[app endBackgroundTask:bgTask];
}];
}
写这个code.Actually背景当应用程序进入后台它将暂停的MPMoviePlayerController所以当它来到前台您发布该调用其中电影控制器实现在类中的方法通知和用这种方法再玩一次。
-(void)playIntroAnimationAgain
{
[[NSNotificationCenter defaultCenter]removeObserver:self name:NOTIFICATION_PlayAgain_Player object:nil];
[self.moviePlayerController play];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playIntroAnimationAgain)name:NOTIFICATION_PlayAgain_Player object:nil];
}
它解决了我的问题。
仍然我没有得到解决方案。你如何解决你的问题? – Myaaoonn