On click the button I present the AVPlayerViewController:
func playVideoPressed(sender: UIButton){
let videoURL = NSURL(string: "someUrl")
let player = AVPlayer(URL: videoURL!)
let playerViewController = AVPlayerViewController()
playerViewController.player = player
self.presentViewController(playerViewController, animated: true) {
playerViewController.player!.play()
}
}
This AVPlayerViewController status bar makes the user interface of the current view controller. Is it possible to hide the status bar from this call to "presentViewController"?
I tried to enable
playerViewController.prefersStatusBarHidden()
but the player continues to display the status bar.
thank
source
share