4

I am currently developing a application which has to be able to show offline videos which need to be downloaded first.

The problem was that these videos can be bigger that the memory that I can allocate to my application. So parts that are downloaded have to be saved immediately instead of saved in a NSData object. I'm hearing conflicting stories on whether or not RESTKit should work, and ASIHTTPRequest seems to be deprecated.

I will follow the suggestion from this thread as it seems to be the best option.

NSURLConnection download large file (>40MB)

Community
  • 1
  • 1
Daan Luttik
  • 2,781
  • 2
  • 24
  • 37

3 Answers3

3

Consider using NSURLConnection to download the video file and write the data directly to a file (NSFileHandle).

One advantage of using this method is that the NSURLConnection didReceiveData delegate method is continuously called as data is received, so you can update a progress bar.

Marcus Adams
  • 53,009
  • 9
  • 91
  • 143
  • This seems like the most viable option... I'll try it later today. (don't worry if it works ill accept you answer. – Daan Luttik Aug 08 '13 at 15:05
0

Check out AFNetworking for network managing. I am not sure if they have video downloading, but the framework works great for images and other types of downloads that I have down before.

Jsdodgers
  • 5,253
  • 2
  • 20
  • 36
0

Without explaining all the hasle with dealing with HTTP responses by chunks and streams I would recommend using AFDownloadRequestOperation. It supports resuming downloads and has callbacks for showing download progress. I love it and use it in most of my projects.

P.S. It uses AFNetworking, which is a great framework for making all kinds of HTTP requests.

carlossless
  • 1,171
  • 8
  • 23
  • Do you happen to have a cocoapod file for this... I can't get it to work and reconfiguring the workspace is such a hassle. – Daan Luttik Aug 08 '13 at 15:06