As the question states, is there any way of rotating a video in avplayer.
Currently, I'm presenting a class that is an instance of avplayercontroller modally. The entire app runs only in portrait mode but I want this video to be played in landscape mode.
I've already tried the "shouldAutorotate" and other methods listed here: Only ONE VIEW landscape mode
Swift just doesn't seem to like allowing modally presented view controllers to be a different orientation.
Code for how my video controller class
import UIKit
import AVFoundation
import AVKit
class streamStuffViewController: AVPlayerViewController {
var isPresented = true
override func viewDidLoad() {
super.viewDidLoad()
self.player = AVPlayer(URL: NSURL(string: currentStream))
self.player.play()
// Do any additional setup after loading the view.
}
override func viewWillDisappear(animated: Bool) {
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewDidDisappear(animated: Bool) {
self.player.pause()
}
}