Can we add button on AVPlayerViewController
and show overlay over that or we need to customize the controls.
Asked
Active
Viewed 389 times
1 Answers
1
You can use View Controller Containment
to add AVPlayerViewController
s view to your UIViewController
then you can add anything you want over the AVPlayerViewController
s view since it is just another view in the view hierarchy...
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)

Ladislav
- 7,223
- 5
- 27
- 31
-
Cant we add customized subtitles to info view rather than going with above approach? – Diksha Sep 03 '18 at 10:26