当应用程序进入前台时不要恢复MPMoviePlayerController [英] Do not resume MPMoviePlayerController when application enters foreground

查看:105
本文介绍了当应用程序进入前台时不要恢复MPMoviePlayerController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am developing an iPhone application which plays the video using MPMoviePlayerController. When I switch to background(device with multi-tasking support), the video play is paused and when I bring my app to foreground video play is resumed.

但是,当我切换到前景时,我不想继续播放视频.我试图在方法applicationWillEnterForeground中暂停MPMoviePlayerController.但是,我认为它们在调用applicationWillEnterForeground之后隐式恢复.是否有任何与applicationDidEnterForegroundapplicationWillEnterBackground相对应的通知方法?

But, when I switch to foreground I do not want my video to be resumed. I tried to pause the MPMoviePlayerController in the method applicationWillEnterForeground. But, I think they resume implicitely after call to applicationWillEnterForeground. Is there any notification methods that corresponds to applicationDidEnterForeground OR applicationWillEnterBackground?

推荐答案

尽管您知道UIApplicationDidEnterForegroundNotificationUIApplicationWillEnterBackgroundNotification不存在,但仍有一些功能对应于同一事物.

Although as you know UIApplicationDidEnterForegroundNotification and UIApplicationWillEnterBackgroundNotification do not exist, there are functions that correspond to the same thing.

他们是

UIApplicationDidBecomeActive:

UIApplicationWillResignActive:

这篇关于当应用程序进入前台时不要恢复MPMoviePlayerController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆