BrikerMan / BMPlayer

A video player for iOS, based on AVPlayer, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, support subtitles.
https://eliyar.biz
MIT License
1.95k stars 418 forks source link

Ios 16.0 cannot play in full screen #354

Open xipeng5 opened 1 year ago

xipeng5 commented 1 year ago

Ios 16.0 cannot play in full screen

2022-11-08 22:47:22.019162+0800 BMPlayerExample[13285:5049044] [Orientation] BUG IN CLIENT OF UIKIT: Setting UIDevice.orientation is not supported. Please use UIWindowScene.requestGeometryUpdate(:) 2022-11-08 22:47:22.019482+0800 BMPlayer_Example[13285:5049044] [Assert] -[UIApplication setStatusBarOrientation:] and -[UIApplication setStatusBarOrientation:animated:] API have been deprecated on iOS 8.0 and are no-ops on iOS 13.0

MahipalAppentus commented 1 year ago

Just update the Pod/SPM and it will work

azisramdhan commented 1 year ago

Hello, I'm having the same problem. It is work now? @xipeng5

sachinhunasnale commented 7 months ago

Please update the function fullScreenButtonPressed() in BMPlayer file in pod @objc fileprivate func fullScreenButtonPressed() { controlView.updateUI(!self.isFullScreen) if isFullScreen { if #available(iOS 16.0, ) { let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene windowScene?.requestGeometryUpdate(.iOS(interfaceOrientations: UIInterfaceOrientationMask.portrait)) } else { UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation") } UIApplication.shared.setStatusBarHidden(false, with: .fade) UIApplication.shared.statusBarOrientation = .portrait } else { if #available(iOS 16.0, ) { let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene windowScene?.requestGeometryUpdate(.iOS(interfaceOrientations: UIInterfaceOrientationMask.landscapeRight)) } else { UIDevice.current.setValue(UIInterfaceOrientation.landscapeRight.rawValue, forKey: "orientation") } UIApplication.shared.setStatusBarHidden(false, with: .fade) UIApplication.shared.statusBarOrientation = .landscapeRight } }

or else if you get any callback we can use the above code in the view controller.