Play video fullscreen in landscape mode, when my entire application is in lock in portrait mode

前端 未结 4 2065
不思量自难忘°
不思量自难忘° 2021-01-03 03:07

I want to play video in landscape mode in fullscreen. And my application is lock in portrait mode. How to implement this. Please help me. Thanks in advance

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-03 03:32

    Simplest solution in swift 3 Add this to your app delegate:

    func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
        if window == self.window {
            return .portrait
        } else {
            return .allButUpsideDown
        }
    }
    

提交回复
热议问题