I have an application that currently comes with all the videos that it can play embedded in it. It doesn't scale very well, and if you don't want to play all the movies, waste disk space. It also makes updating the app less desirable because you need to re-download all the movies.
What I would like to do is download the movie on the fly, play it during the download, and then, if it is downloaded successfully, save it on the file system so that the next time they want to watch it, it's local file.
I can do everything that is needed for the video, but I am currently serving it as an .mp4 file from Amazon S3 with the video / mp 4 type, and so the first half of my problem is working fine: loading the movies, and MPMovieViewController will start playing it like only he finds that he has downloaded "enough."
Is it possible to use the cache of this video file so that I can save it and control how long it has been in the file system? It seems like this would be the easiest approach.
I focus on iOS 5 + 6, but if the only solution available for iOS 6, I would also think. Thank!
UPDATE: Using AFNetworking, I'm halfway now, I think. I upload a video file from the server and listen to the download process. As soon as I see that 25% of the video has been downloaded, I start playback in the local file using MPMoviePlayerController.
, , - , , , . , 25% , ... ... , . - , , " ", . , , , , , , , ?
MPMoviePlayerController, , , ? - ?