6

I want to stream a stream-optimized video from a URL (HTTP) to minimize the latency before it starts playing, and then save it in the cache for subsequent plays. It doesn't appear I can do this though, as MediaPlayer/VideoView don't seem to offer any way of getting a handle on the video that I can use to write it to file.

It seems crazy that I would need to stream it first and then download it a 2nd time to be able to cache it, or else forfeit the streaming and just download the whole thing first. I've got the whole thing in memory, but the Android API isn't giving me access to it.

Others have asked this a while ago but responses were scarce. Does anyone have a definitive answer on this?

Ry-Fi
  • 81
  • 6
  • Yeah, it seems I'm not overlooking anything and that this just isn't possible. As I think about it, it makes more sense. The contract of a streaming player is to stream and play the video, with no guarantee that the entire video will reside in memory (especially if the video is large, even though in my case it isn't). Off to devise my own solution for this scenario... – Ry-Fi Apr 08 '14 at 21:52
  • Have you been able to figure out a way out? I need this functionality. – rahulritesh Oct 08 '14 at 06:10
  • 2
    Dave @Dave has built a proxy server here: http://stackoverflow.com/questions/12701249/getting-access-to-media-player-cache - haven't tried if it's working, though. – Oliver Hausler Dec 09 '14 at 19:44
  • @OliverHausler That's very cool, a solution I sure didn't think of. This is exactly what I'm going to do. Thanks for pointing this out! – Ry-Fi Jan 05 '15 at 20:19
  • AndroidVideoCache (https://github.com/danikula/AndroidVideoCache) does exactly you want. – danik Jun 04 '15 at 14:32

0 Answers0