I would like to rotate my view controller when movie play.
My question might be duplicate but I tried many ways when I find in stack overflow. But all codes do not work. May be I put the codes in wrong way.
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
//return[.portrait,.landscapeRight]
return .landscapeLeft
}
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
//return UIInterfaceOrientation.landscapeRight
return .landscapeLeft
}
I put this code to vlcplayerviewcontroller.swift file.
When user clicks on play button, then it will goes to vlcplayerviewcontroller.swift and I would like to show the movie in Landscape mode automatically. I have no idea of how can I do this.
My reference link is How to lock orientation of one view controller to portrait mode only in Swift.