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.
views:
933answers:
3one 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.
I haven't tested this, but it may be possible to override [NSURLCache sharedURLCache]
with a custom disk-only cache implementation. If MPMoviePlayerController
uses NSURLRequest
, it could work.
I haven't tested this, but it may be possible to override [NSURLCache sharedURLCache] with a custom disk-only cache implementation. If MPMoviePlayerController uses NSURLRequest, it could work.
This won't work. I checked this out. I think that MPMoviePlayerController isn't using caching at all.