title: AVPlayer Content Modes
body: <p>I have a AVPlayer, and am using it as a background in my UIView as an aesthetic. To initialize and instantiate it, I do</p>
  
  <pre><code>override func viewDidAppear(_ animated: Bool) {
      super.viewDidAppear(animated)
  
      guard let path = Bundle.main.path(forResource: "Background", ofType:"mp4") else {
          debugPrint("Background.mp4 not found")
          return
      }
  
      let player = AVPlayer(url: URL(fileURLWithPath: path))
      let playerLayer = AVPlayerLayer(player: player)
  
      playerLayer.frame = self.view.bounds
      player.actionAtItemEnd = .none
      player.volume = 0.0
  
      //chage content mode ** TODO **
  
      self.view.layer.addSublayer(playerLayer)
      player.play()
  
  }
  </code></pre>
  
  <p>When I run this, the video plays just as expected, however the AVPlayer sets the content mode to <code>fitToWidth</code> as a default. I searched through all the methods of <code>player</code> and <code>playerLayer</code> for some type of method on changing content type, but to no avail.</p>
  
  <p>What I want is instead of <code>fitToWidth</code> I would like <strong><code>fitToHeight</code></strong>.</p>
  
  <p>Any thoughts? Thanks for looking!</p>