Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @objc func onRotated() {
- // portrait
- if UIDeviceOrientationIsPortrait(UIDevice.current.orientation) {
- playerController.view.frame = CGRect(x: 0, y: 200, width: UIScreen.main.bounds.width, height: 250)
- }
- // landscape
- else if UIDeviceOrientationIsLandscape(UIDevice.current.orientation) {
- playerController.view.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
- }
- }
Add Comment
Please, Sign In to add comment