Reputation: 5547
I have an AVPlayerViewController
with an AVPlayer
inside. By default the playback controls appear on the bottom of the view, is there a way to make them appear on top of the view instead?
Upvotes: 0
Views: 1599
Reputation: 534885
There's no supported built-in way. You'd have to roll your own controls to do that.
Also keep in mind that the AVPlayerViewController's view doesn't have to occupy the whole screen. So the controls may appear at the bottom of the view but that doesn't mean they have to appear at the bottom of the screen. Design around the view so that it doesn't interfere with your other interface.
Upvotes: 3
Reputation: 42449
AVPlayerViewController
has a private UIView *_controlsView
which holds the control rack. You could iterate through the subviews of the view controller or create an interface which exposes this property to get a reference to it.
As this is an undocumented view, use caution when messing with private properties. The player might not even support moving the _controlsView
around.
I'd also look into the AVPlaybackControlsViewController *_playbackControlsViewController;
property if the _controlsView
does not exactly fit your needs.
AVPlayerViewController
private header (for reference).
Upvotes: 1