Iphone – Caching videos to disk after successful preload by MPMoviePlayerController


After launching a video using MPMoviePlayerController's initWithContentURL:, is it possible to cache the downloaded video so that the next time the video is played it can be loaded via a local file:// URI? I understand that it's possible to do my own downloading and then launch the movie player, however I would like to take advantage of the player's ability to start prior to completion of preload.

Best Solution

one trick, is to start the download to disk - (using atomic : YES), wait 10 seconds, and point the movie player to the local disk path. it will "download" while playing the incomplete file.

next time, just check if the file exists first.

I got this working pretty well on WIFI connections, but on 3G there were all kinds of crashyness.

worse, there were issues with incomplete local files. let me know if it is worth it.

Related Question