title: AVPlayer can't load .mov file saved after re-running app via xcode
body: <p>I have this app in which the main purpose is to record video using AVFoundation, and then saving the outputfile delegate.</p>
  
  <p>On first any normal run the app could properly record and save the video, and I could load the resulting outputfile URL into Avplayer I have on the next viewcontroller.</p>
  
  <p>The AVPlayer would play just fine normally if the Xcode is not re-run. What I mean with rerunning is tapping into the Command+R again or clicking on the Play button on xcode to rebuild re-run.</p>
  
  <p>What happens when I run the app again is that I could still see the files and list them via print, but when I'm trying to access the recorded file the app would no longer play the video. It would seem that the video wasn't loaded properly or anything even if it had already been working earlier. After this happens I could still go on record new ones and play the newly recorded ones, but not the old files.</p>
  
  <p>The old files before rebuild of app would just look like this on AVPlayer<a href="https://i.stack.imgur.com/O1eVU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O1eVU.png" alt="this is how it would look, I just took it from another stackoverflow which shows the same view but the problem is different"></a></p>
  
  <p>Also the AVPlayer would successfully return .readyToPlay status on my observer.</p>
  
  <p>I'm confused how should I go on fixing this one.</p>
  
  <pre><code>if let videoPreviewController = storyBoard.instantiateViewController(withIdentifier: "VideoPreviewController") as? VideoPreviewController {
  
  
                      let url = NSURL(fileURLWithPath: "file:///var/mobile/Containers/Data/Application/61E182ED-D490-4C7D-BAB7-C90D095C7E43/Documents/Thursday,%208%20June%202017%20at%201:47:51%20PM%20Philippine%20Standard%20Time.mov")
                      videoPreviewController.player = AVPlayer()
                      let playerItem = AVPlayerItem.init(url: url as URL)
                      videoPreviewController.player?.replaceCurrentItem(with: playerItem)
  
                      videoPreviewController.report = relationship
                      videoPreviewController.appointment = self.appointment
                      navigation.pushViewController(videoPreviewController, animated: true)
                  }
  </code></pre>