Entering full screen in MPMoviePlayerController ca

2019-02-08 16:35发布

问题:

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.

In this viewController (that contains the Movie Player View), I set the viewWillDisappear to set objects to nil.

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.

In iOS5, those methods were not called.

回答1:

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.



回答2:

To everyone has noticed that and having problem with this, I found this report in community Open Radar: http://openradar.appspot.com/12327997



回答3:

I am not sure this is a question but in case someone has a problem with the issue herein stated, that is, someone using a viewController (that contains the Movie Player View), I found the solution:

I was using a view controller with the Movie Player Controller and then presented this view controller as a subview. I just got rid of it and used the MoviePlayer.view as a subview directly and it works just fine.

Not a problem with iOS 5, but now, it is. Fix it and enjoy!