1

我正在开发一个 iPhone 应用程序,它使用MPMoviePlayerController. 当我切换到后台(支持多任务的设备)时,视频播放暂停,当我将我的应用程序带到前台时,视频播放恢复。

但是,当我切换到前台时,我不想恢复我的视频。我试图MPMoviePlayerController在方法 applicationWillEnterForeground 中暂停。但是,我认为他们在调用applicationWillEnterForeground. 是否有任何与 applicationDidEnterForegroundOR对应的通知方法applicationWillEnterBackground

4

2 回答 2

2

尽管如您所知UIApplicationDidEnterForegroundNotification并且UIApplicationWillEnterBackgroundNotification不存在,但有些功能对应于同一事物。

他们是,

UIApplicationDidBecomeActive

UIApplicationWillResignActive

于 2011-08-01T00:57:59.870 回答
0

在此处查看 UIApplication 类参考:https ://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006728

在该文档的通知部分,您会找到发布到通知中心的通知。您的班级可以注册以接收这些通知并适当地处理视频播放状态。

希望这是您正在寻找的答案。

于 2011-07-15T12:44:47.563 回答