当应用程序进入前台时不要恢复MPMoviePlayerController [英] Do not resume MPMoviePlayerController when application enters foreground
问题描述
我正在开发一个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
之后隐式恢复.是否有任何与applicationDidEnterForeground
或applicationWillEnterBackground
相对应的通知方法?
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
?
推荐答案
尽管您知道UIApplicationDidEnterForegroundNotification
和UIApplicationWillEnterBackgroundNotification
不存在,但仍有一些功能对应于同一事物.
Although as you know UIApplicationDidEnterForegroundNotification
and UIApplicationWillEnterBackgroundNotification
do not exist, there are functions that correspond to the same thing.
他们是
UIApplicationDidBecomeActive
:
和
UIApplicationWillResignActive
:
这篇关于当应用程序进入前台时不要恢复MPMoviePlayerController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!