AndroidVideoCache icon indicating copy to clipboard operation
AndroidVideoCache copied to clipboard

Clear cache

Open knezmilos13 opened this issue 8 years ago • 2 comments

Hi, I added a couple of things that I needed so just wanted to see if you want them in original project as well. If not, nvm :)

I wanted to be able to:

  • clear entire cache from time to time, e.g. when completely changing the "playlist". I used your code from the sample for this (and also updated the sample to remove that, now redundant, code)
  • clear single cached video when I 100% know it won't get played again; that way I might avoid another video getting kicked out from the cache because there's not enough space

I've noticed a problem - it seems that the info storage entries are never removed, even if the corresponding video is removed from cache. The entries may be small, but even if it takes thousands, it's a risk I can't take, so I had both of those operations above do the full storage clear and sigle entry clear respectively. I didn't try to implement this when the normal removal of old cached files is done, the "clear entire cache" thingy is enough for me, since I call that periodically.

knezmilos13 avatar Jun 15 '17 13:06 knezmilos13

Thank you for sharing these changes. I was just about to implement similar functionality myself. In my case, the content at the source periodically changes, but the URL doesn't and prior to this, there was no easy way to clean out the cache to force it to download new.

wojtow avatar Apr 05 '19 22:04 wojtow

good news .

jdpxiaoming avatar May 28 '20 03:05 jdpxiaoming