在MPMoviePlayerController中输入全屏调用viewWillDisappear和viewDidDisappear [英] Entering full screen in MPMoviePlayerController calls viewWillDisappear and viewDidDisappear
问题描述
要在我的应用中播放视频,我设置 MPMoviePlayerController
并将其添加到子视图中。用户可以使用捏合手势更改为全屏模式。
To play video in my app, I set MPMoviePlayerController
and add it to subview. The user can change to full screen mode using pinch gesture.
在此 viewController
中(包含电影播放器视图) ),我设置 viewWillDisappear
将对象设置为nil。
In this viewController
(that contains the Movie Player View), I set the viewWillDisappear
to set objects to nil.
但是,在iOS 6中,激活全屏模式时包含Movie Player视图的视图控制器中的 MPMoviePlayerController
调用方法 viewWillDisappear
和 viewDidDisappear
。
But, in iOS 6, when activating fullscreen mode the MPMoviePlayerController
in the view controller that contains the Movie Player View calls the methods viewWillDisappear
and viewDidDisappear
.
在iOS5中,没有调用这些方法。
In iOS5, those methods were not called.
推荐答案
我也遇到过这个问题,这让我很头疼。在修复错误之前我的临时解决方案是在 viewWillDisappear:
和/或<$中检查玩家的全屏
布尔值C $ C> viewDidDisappear:。如果它返回 YES
,则电影正在进入全屏模式,你应该避免做任何可能会中断它的事情。
I came across this issue as well and it caused me a lot of headache. My temporary solution until the bug is fixed is to check the player's fullscreen
Boolean value in viewWillDisappear:
and/or viewDidDisappear:
. If it returns YES
, the movie is entering fullscreen mode and you should refrain from doing anything that might interrupt it.
这篇关于在MPMoviePlayerController中输入全屏调用viewWillDisappear和viewDidDisappear的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!