title: How to present a full screen AVPlayerViewController in SwiftUI
body: <p>In SwiftUI, it seems like the best way to set up an AVPlayerViewController is to use the UIViewControllerRepresentable in a fashion somewhat like this...</p>
  
  <pre><code>struct PlayerViewController: UIViewControllerRepresentable {
      var videoURL: URL?
  
  
      private var player: AVPlayer {
          return AVPlayer(url: videoURL!)
      }
  
  
      func makeUIViewController(context: Context) -&gt; AVPlayerViewController {
          let controller =  AVPlayerViewController()
          controller.modalPresentationStyle = .fullScreen
          controller.player = player
          controller.player?.play()
          return controller
      }
  
      func updateUIViewController(_ playerController: AVPlayerViewController, context: Context) {
  
      }
  }
  </code></pre>
  
  <p>However from the documentation that the only way to show this controller in a full-screen way is to present it using a sheet.</p>
  
  <pre><code>.sheet(isPresented: $showingDetail) {
      PlayerViewController(videoURL: URL(string: "..."))
        .edgesIgnoringSafeArea(.all)
  }
  </code></pre>
  
  <p>This doesn't give you a full-screen video with a dismiss button but a sheet modal which can be swiped away instead.</p>
  
  <p>In standard non-SwiftUI Swift, it would seem like the best way would be to present this controller...</p>
  
  <pre><code>let controller = PlayerViewController(videoURL: URL(string: "..."))
  self.present(controller, animated: true)
  </code></pre>
  
  <p>...but SwiftUI doesn't have a <code>self.present</code> as part of it. What would be the best way to present a full-screen video in SwiftUI?</p>