由於定向模式在iOS的10的處理方式則有以下選項:
「政治」 -correct解決方案
1)讓你的應用在所有的在info.plist中
2)方向性模式不允許景觀其他地方
的哈克解決方案
每次旋轉手機時,都會調用您的AppDelegate,以瞭解特定窗口的支持方向。因此,如果您可以檢測到「當前窗口」內的視圖控制器是youtube視頻控制器,那麼您可以返回所有方向,否則返回portret。
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
guard let topController = window?.topController() else {
return application.supportedInterfaceOrientations(for: window)
}
let className = NSStringFromClass(type(of: topController))
let hackyViewControllers = ["avfullscreenviewcontroller"]
if hackyViewControllers.contains(className.lowercased()) {
return .allButUpsideDown
} else {
return .portrait
}
}
**,你可以看到我們檢查AVFullScreenViewController這正是UIViewController子類負責全屏顯示YouTube視頻。
我認爲只有Google員工才能回答您。我沒有看到有關您可以在[Data API](https://developers.google.com/youtube/v3/revision_history)和[IOS Helper](https://開發人員)中看到的問題的任何更新版本。 google.com/youtube/v3/guides/ios_youtube_helper#best-practices-and-limitations)。如果您認爲這是一個錯誤,那麼請嘗試[提交一張票](https://code.google.com/p/gdata-issues/issues/list?q=label:APi-YouTube)瞭解此問題。 – KENdi