title: How to add cornerRadius to AVPlayerViewController in Swift?
body: <p>i'm working on video player app that written in <code>Swift</code>.</p>
  
  <p>my problem is i should make <code>AVPlayerViewController</code> corners curve. but i want to use just <code>AVPlayerViewController</code> not any other classes.</p>
  
  <p>what i did now:</p>
  
  <pre><code>fileprivate func setupPlayer() {
      let player = AVPlayer(url: videoURL)
      let playerViewController = AVPlayerViewController()
      playerViewController.view.frame = CGRect.init(x: xPosition,
                                                    y: yPosition,
                                                    width: 200,
                                                    height: 100)
      playerViewController.player = player
      self.addChild(playerViewController)
      self.view.addSubview(playerViewController.view)
      playerViewController.didMove(toParent: self)
      playerViewController.videoGravity = AVLayerVideoGravity.init(rawValue: "")
      playerViewController.view.backgroundColor = UIColor(displayP3Red: 0/255, green: 0/255, blue: 0/255, alpha: 0)
      playerViewController.view.layer.cornerRadius = 20
      playerViewController.contentOverlayView?.isHidden = true
      playerViewController.contentOverlayView?.alpha = 0
  }
  </code></pre>
  
  <h2>Problem:</h2>
  
  <p><strong>what i already have is:</strong> <a href="https://i.stack.imgur.com/Dho7J.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Dho7J.png" alt="enter image description here"></a></p>
  
  <h2>Example Solution:</h2>
  
  <p><strong>but i want to have something curve like the one in appstore:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/SbK2X.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/SbK2X.jpg" alt="enter image description here"></a></p>