I have added AVPlayerViewController view half of my current viewcontroller view then playing video from URL so far everything okay and it is working as excepted.
Actually i wanted to do landscape mode when user clicks on full screen button and here not able to find out that button action. i have tried many things nothing helps
Detect Video playing full screen in Portrait or landscape
Is there any notification or presentedViewController or something else to find out?
I have already read so many question and did not get any answers so that posting here.
if self.player == nil {
self.playerVwController.view.bounds = self.videoPlayerView.bounds
self.playerVwController.view.frame = CGRect(x: 0, y: 0, width: self.videoPlayerView.frame.size.width, height:self.videoPlayerView.frame.size.height)
self.videoPlayerView.addSubview(self.playerVwController.view)
}
@IBOutlet weak var videoPlayerView: UIView!
var player : AVPlayer!
let playerVwController = AVPlayerViewController()