[iOS] AVPlayer won't play file after some time

I download a mp4 file into the date folder. I am able to run an AVPlayer and view the video in the app. After some time video won't play. If I enable UIFileSharingEnabled and check if file exists, I can see it's there but then it won't play even from accessing it through Files. If I copy the file from iOS to Mac then I can pay the video on Mac, but not anymore on iOS.

If I delete the app, install again and download the video while UIFileSharingEnabled and if it's played in the app it can be played in the Files app, but again after some time it's not playable again... I can see only first frame. I can even see the length of video. It happens to multiple videos.

Any clues?

my mistake: "app data folder"* not "date folder"

Try this:

  1. In your app, download the file.

  2. Play it.

  3. Use the Xcode organiser to download a copy of your app’s container.

  4. Back in your app, keep playing until things break.

  5. Repeat step 3.

  6. Compare the files in the containers from steps 3 and 5. Are they the same?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@7h4r05 Have you been able to identify a solution to this issue? I've encountered a problem that appears to be almost identical.

[iOS] AVPlayer won't play file after some time
 
 
Q