0

我们可以添加按钮AVPlayerViewController并在其上显示覆盖,或者我们需要自定义控件。

4

1 回答 1

1

您可以使用View Controller ContainmentAVPlayerViewControllers 视图添加到您的视图中,UIViewController然后您可以在 s 视图上添加任何您想要的内容,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)
于 2018-09-03T08:08:22.303 回答