title: Local Video Play on Real device Iphone
body: <p>Use <a href="https://www.youtube.com/watch?v=bRhdFymK-eE" rel="nofollow noreferrer">this</a> link I am trying to play a video on the simulator with <code>AVPlayerViewController</code>. That work on simulator perfectly. But when I am trying to play it on real Device. It doesn't work.</p>
  <pre><code>import UIKit
  import AVKit
  import  AVFoundation
  
  class SafaribroserViewController: UIViewController {
  
  var playerViewController = AVPlayerViewController()
  var playerView = AVPlayer()
  
  override func viewDidLoad() {
      super.viewDidLoad()
   
  }
  
  @IBAction func hsdgfsf(_ sender: Any) {
      let fileURL = NSURL.init(fileURLWithPath: &quot;/Users/macmini/Downloads/QRCodeReader-master 3/QRCodeReader/small.mp4&quot;)
      playerView = AVPlayer(url: fileURL as URL)
      playerViewController.player = playerView
      present(playerViewController,animated:true) {
          self.playerViewController.player?.play()
      }
  }
  </code></pre>
  <blockquote>
  <p>output on real device</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/8KgI1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8KgI1.png" alt="enter image description here" /></a></p>
  <blockquote>
  <p>Note:- My real device is connected to MacMini Hotspot.</p>
  <p>How Can I Play video on my real device? Thanks</p>
  </blockquote>