当 AVPlayerViewController 进入全屏时处理
Handle when AVPlayerViewController goes full screen
我的应用程序是为纵向模式实现的。对于 MPMoviePlayerController 播放器,有 MPMoviePlayerWillEnterFullscreenNotification 和 MPMoviePlayerWillExitFullscreenNotification 等通知。然后我可以在应用程序委托中调整 supportedInterfaceOrientationsForWindow。它运作良好。
是否可以使用 KVO 和新 player/item 处理任何 属性 更改,以便我可以检测到它在没有私人 api 的情况下全屏显示的时刻?我试图观察界限,呈现模式。但是当按下全屏按钮时没有任何改变。为什么无法处理 AVPlayerViewController 的按钮?
答案在这里 suggesting to observe the videoBounds 我最初观察到但对我不起作用的 AVPlayerViewController。
此解决方案并不总是有效。与AVPlayerViewController控制器的videoBounds相关的通知属性并不总是发出。
我的应用程序是为纵向模式实现的。对于 MPMoviePlayerController 播放器,有 MPMoviePlayerWillEnterFullscreenNotification 和 MPMoviePlayerWillExitFullscreenNotification 等通知。然后我可以在应用程序委托中调整 supportedInterfaceOrientationsForWindow。它运作良好。
是否可以使用 KVO 和新 player/item 处理任何 属性 更改,以便我可以检测到它在没有私人 api 的情况下全屏显示的时刻?我试图观察界限,呈现模式。但是当按下全屏按钮时没有任何改变。为什么无法处理 AVPlayerViewController 的按钮?
答案在这里 suggesting to observe the videoBounds 我最初观察到但对我不起作用的 AVPlayerViewController。
此解决方案并不总是有效。与AVPlayerViewController控制器的videoBounds相关的通知属性并不总是发出。