在iOs应用中播放视频时,我需要它在应用程序发送到后台时暂停,并在应用程序从后台返回时恢复。
- (void)onApplicationDidBecomeActive:(NSNotification *)notif
{
NSLog(@"player: app did become active...");
[self.videoPlayer play];
}
- (void)onApplicationDidEnterBackground:(NSNotification *)notif
{
NSLog(@"player: app did enter background...");
[self.videoPlayer pause];
[self.videoPlayer setFullscreen:NO];
}
在iOS7上,这可以正常运行但io iOs8似乎在当前的一个播放器下面创建了另一个播放器。 (self.videoPlayer是一个MPMoviePlayerController)
这是为什么?