Reputation: 381
Is there any way to resize and/or reposition the video displayed within an AVPlayerViewController? I want to do this to support zooming. I know it can be done when using AVPlayerLayer, but have found no way to do it with AVPlayerViewController. Changing the bounds of AVPlayerViewController's view, or placing AVPlayerViewController within a UIScrollView don't work, of course, because the entire view resizes, including the built-in controls.
Or a more general question: any way to support pinch zoom on AVPlayerViewController? (I want full zoom, not just switch to and from fullscreen mode.)
Upvotes: 1
Views: 456
Reputation: 381
It's not ideal, but I ended up doing this: to zoom in, I adjusted _playerViewController.view.frame, and set _playerViewController.showsPlaybackControls to YES. So when zoomed in, you dont' see the player controls. That was the best I could come up with. But probably better to just write your own player controller.
Upvotes: 0