title: Set size for Video with AVPlayerViewController
body: <p>I need to play a short video at the end of my game.</p>
  
  <p>I created an AVPlayerViewController on my storyboard with a modal presentation using a segue from the previous View Controller.</p>
  
  <p>However I want the video NOT to cover the whole screen. Let's say 50% (centered) of the screen size.</p>
  
  <p>Here is the code I tried : </p>
  
  <pre><code>import AVKit
  import AVFoundation
  import UIKit
  
  class VideoPlayerViewController: AVPlayerViewController {
  
  override func viewDidLoad() {
      super.viewDidLoad()
  }
  
  override func viewDidAppear(animated: Bool) {
      // Play video
      player?.play()
  }
  
  override func viewDidLayoutSubviews() {
      print(videoBounds)
      self.view.bounds = videoBounds
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The problem is that the video scales to the whole screen is very small (like something around 100*70px). I believe the default size is 100*100 at some point and it scales it to match my video ratio.</p>
  
  <p>If I don't specify bounds, it scales to the whole screen (video gravity don't let me the choice).</p>
  
  <p>If I reduce the size on my whole view in viewDidLayoutSubviews, it's still not okay because this method is called multiple times so I keep changing my view bounds.</p>
  
  <p>I can't believe how hard it is to display a local video on part of the screen with AVPlayerViewController...</p>
  
  <p>Any help ?</p>