Open sn4f opened 9 months ago
Thanks for supporting me and great question.
I have planned for building pre-caching hook. You can try my idea here: https://github.com/nguyenvanphituoc/react-native-cache-video/blob/main/example/src/hooks/useVideoInBackground.tsx.
Let me explain this: Assuming you are playing a list of video then want to pre-cache some videos, you need to try to run a shadowing video that I called video in background to do this job and it's style is hidden from your user. It receive a list of pre-caching url and trying cache this in sequence, about m3u8 type that only cache first segment as *.ts file in playlist ( like tiktok or some-else it only cache for first 5s). The problem here is about performance of using multiple video session at the same time with this reason why I still pending
About your concerns of the delay between each call is correctly that depend on your phone performance too, I suggest you using recyclelist to solve this
Hey @nguyenvanphituoc, absolutely awesome library!
About caching m3u8 videos - is it possible to not use multiple video sessions but just download the first one or two .ts
files if we know the name of it?
Hey @nguyenvanphituoc, absolutely awesome library!
About caching m3u8 videos - is it possible to not use multiple video sessions but just download the first one or two
.ts
files if we know the name of it?
Interesting question.
I have implemented it before, but it not helps improve performance much, at least on mine end. Because, the player will decide which playlist should play that depends on network, performance, resolution... so If you try cache ts file without video sessions then video has probability that does not play them. Yes, I will re-deploy it function for you, don't worry.
This case only apply for m3u8 stream with only one playlist, I think it work well in testing environment but not in product environment
Hello, first of all, I would like to thank you for the library. Is there a planned feature that would allow loading a list of movies before playback? The current hook is based on a single URL, but I need to load, for example, 4 movies into the cache. My second question concerns the reuse of the hook on the same URL that I loaded earlier. Is there a delay between each call to setVideoPlayUrlBy, and can it be somehow changed?