我们是否可以在AVPlayerViewController上添加按钮并显示覆盖,或者我们需要自定义控件。
发布于 2018-09-03 16:08:22
您可以使用View Controller Containment将AVPlayerViewController的视图添加到UIViewController中,然后可以在AVPlayerViewController的视图上添加任何您想要的内容,因为它只是视图层次结构中的另一个视图……
let avPlayerVC = AVPlayerViewController()
//configure the playerVC
addChildViewController(avPlayerVC)
avPlayerVC.view.frame = frame//or use autolayout to constran the view properly
view.addSubview(avPlayerVC.view)
avPlayerVC.didMove(toParentViewController: self)
//add controls over it -> I called it ControlsView
let controls = ControlsView()
view.addSubview(controls)https://stackoverflow.com/questions/52145085
复制相似问题