moviePlayer = MPMoviePlayerController(contentURL: url)
moviePlayer.view.frame = CGRect(x: 0, y:{layoutguide.height}, width:
self.view.frame.width, height: 300)
self.
This gets the length (in points) of the portion of a view controller's view
that is overlaid by translucent or transparent UIKit
bars.
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
let topSpace:CGFloat
let bottomSpace:CGFloat
if #available(iOS 11.0, *) {
topSpace = self.view.safeAreaInsets.top
bottomSpace = self.view.safeAreaInsets.bottom
} else {
topSpace = self.topLayoutGuide.length
bottomSpace = self.bottomLayoutGuide.length
}
}