Caching Streaming video
I am trying to playback video in my iOS app while I am loading and caching it at the same time. I fetch the video using a NSURLConnection and then store it in a local file, I start video playback of the local video file after a certain number of bytes are received. I have it working great in the simulator, I can start playing the video before I have received all of it, but when I go to run my app on my iPodTouch, I can only seem to play up to the number of bytes I had already rece开发者_StackOverflow中文版ived before I started playback. I can only play all of the video if I wait until I have receive the entire file before I start playback. I can also get the video to play completely if I stop the failed attempt with a [video stop] message and then start playing it again, pausing the video only doesn't work.
I think you can use the original url when downloading is not finished and the cached file url when downloading is done.
精彩评论