0
votes

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()
1
are you used the backbutton or only you want to rotate the AVPlayerViewController - Anbu.Karthik
AVPlayerVeiwcontroller need to show full screen - karthikeyan
are you used the backbutton or only used fullscreen button - Anbu.Karthik
only full screen button there is no custom button - karthikeyan
then why you make struggle just rotate your AVPlayerViewController or your videoPlayerView - Anbu.Karthik

1 Answers

2
votes

Proper way to find a action use KVO to video player contentOverlayView bounds..

as mentioned Here

Anyway The KVO will not work for iOS 11(i am not sure about this, but we have faced), So you would subclass your

AVPlayerViewController as mentioned Here