2

I have developed the code for downloading the mp4 video from server. It does work perfectly sometime but sometime the video which is downloaded is not proper so its not playing. Sometime it that downloaded video is off just 2kb which is not the correct or might be not downloaded properly. So is there any way to check is the downloaded mp4 file is correct?

Thanks in advance.

Satish
  • 1,012
  • 2
  • 15
  • 32

2 Answers2

1

I am not a iPhone developer, but I would suggest computing a checksum on the file downloaded and compare that to a checksum that can be requested from where the file is downloaded.

Check for instance Compute a checksum on the iPhone from NSData for a checksum example.

Community
  • 1
  • 1
Jontas
  • 409
  • 3
  • 12
0

I encountered a similar issue when using AVAssetExportSession to cache a video that was being streamed from the server. I solved this by using isPlayable on AVAsset. If the property returned false I would remove the cached video and stream it from the server instead. Hope this solves your problem.

Paul Abrudan
  • 68
  • 1
  • 7