简体   繁体   中英

AVPlayerViewController full screen button Action?

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()

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM