MPMoviePlayerController消除了在iOS 6中无法正常工作的全屏模式 [英] MPMoviePlayerController dismissing full screen mode not working in iOS 6
问题描述
MPMoviePlayerController
在使用iOS 5的iPad上正常工作,最初视频开始时将 MPMoviePlayerController
添加到自我子视图在某个帧上。按 MPMoviePlayerController上的全屏按钮
以全屏显示电影的嵌入式控件,再次点击该按钮会将视频带回iOS 5中的初始帧。但是在iOS 6中,当我按下全屏按钮将视频带到初始帧时,视频刚刚离开屏幕。看起来Apple已经对 MPMoviePlayer
类进行了一些未记录的更改,这导致了这种奇怪的行为。有没有修复此问题的人?
The MPMoviePlayerController
working fine in iPad with iOS 5, initially the video starts by adding MPMoviePlayerController
to subview of self at certain frame .Pressing full screen button on MPMoviePlayerController
embedded controls displaying the movie in full screen,again tapping the button will bring the video back to the initial frame in iOS 5. But in iOS 6, the when I press full screen button to bring the video to initial frame, the video just gone out of screen. Looks like Apple has made some undocumented change to MPMoviePlayer
class that is causing this weird behaviour. Anyone having the fix for this?
推荐答案
我自己修复了这个问题,在iOS 6中,apple已经做了一些无证的更改 MPMoviePLayerController
类,当您点击全屏按钮时, viewWillDisappear
和 viewDidDisAppear
调用控制器启动 MPMoviePLayerController
及其ParentController。
I have fixed this issue myself, in iOS 6, apple has made some undocumented changes to MPMoviePLayerController
class, when you tap on full screen button, the viewWillDisappear
and viewDidDisAppear
gets called for both the controller launching MPMoviePLayerController
and its ParentController.
在我的项目(pdf阅读器)中,我有一个非常复杂的视图层次结构,在视图Controller中添加一个阅读器,然后添加readerPageContents按钮(图像库,视频,链接到阅读器页面,然后在视频按钮上播放视频。所以在全屏启动视频时,以及当我按切换屏幕时调用ViewWillDisappear和 ViewDidDisappear
按钮将视频带到初始帧,再次调用两个控制器的 ViewWillAppear
和 ViewDidAppear
我正在创建pdf再次在父控制器viewDidAppear中删除视频。
In My Project (a pdf reader), I have a very complex view hierarchy, adding a reader in view Controller, then adding the readerPageContents buttons(image Gallery, video, link) to reader page and then playing video on video button tap.So it was calling the ViewWillDisappear and ViewDidDisappear
when launching the video in full screen, and when when I press toggle screen button to bring the video to initial frame, the ViewWillAppear
and ViewDidAppear
of both controllers called again and I was creating the pdf page again in parent's controller viewDidAppear which was removing the video.
更容易修复它以避免 ViewDidDisappear
和 ViewWillDisappear
通过设置一些 BOOL
来调用。
So easier fix it to avoid ViewDidDisappear
and ViewWillDisappear
gets called by setting some BOOL
.
这篇关于MPMoviePlayerController消除了在iOS 6中无法正常工作的全屏模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!