Closed jln-dk closed 2 years ago
@kfiroo Could you please have a look at this PR?
Please merge that one. In my project I also need to cache videos and audio.
In fact you should be renaming the whole project to react-native-cached-files
:)
Thanks!
@chrusart @kfiroo Please merge this PR. We all need this option in the package. Thanks
@jesperlndk can you please explain how this will work for example with react-native-video? How react-native-video sees that the videos are cached? How they interact with each other?
@DavitVosk The CacheManger of react-native-cached-image is able to take any web URL and cache it (download the file and store it locally for future use). With this change it will do it's job no matter what type of file it is. So it could be a video file in your situation, and then you just pass the cached file URL to react-native-video.
@jesperlndk Thanks for your answer. I receive Download failed
when trying to cache videos with qt
extension (recorded video), but with mp4 it worked as needed. Going deeply into the codes I saw that it throws that error due to the following message: “1ee5087081f9427bf3e80a3c4b622c9393a7051b.qt.tmp” couldn’t be moved to “...MY_s3_amazonaws_com_569052e95feac8563a7388c06364f9937a7e6204” because an item with the same name already exists.
. Maybe the problem is video extension?
Changed generateCacheKey so it now supports all file extensions
Before it only supported image specific file types. I see no need for that, because the ImageCacheManager now can be used to cache any type of file, e.g. video files or pdf files.