views:

81

answers:

3

First question is, given a url to an mp4 video, how can I save that file to disk? The followup to that is while its saving, can I begin playback after its buffered some of the video to disk or do I have to wait for the entire file to be written and then:

MPMoviePlayerController* theMovie=[[MPMoviePlayerController alloc] initWithContentURL:theURL]; 

using the path to the local file.

Thanks, Sam

A: 

The MPMoviePlayerController will start downloading the movie to it's own cache and will start playing the video as soon as enough data has been downloaded.

AFAIK there is no way to control the download and to for example save it to a known file that you specify.

St3fan
+1  A: 

1.Using NSURLDownload or NSURLConnection can implement your request.

2.play downloaded file or localfile, just like play url link

[NSURL fileURLWithPath:yourlocalpath];

flycomputer
+1  A: 

There is no simple way to do this, but you could use NSURLConnection to download the file and re-serve it from a specialized HTTP server of your making running locally on the device (your server would save the file to disk and reserve up the partial download for MPMoviePlayerController to access)

rpetrich