1

I have an app like Instagram, I play videos with video_player. If the user plays a video and watches that, scrolls to the next video, and then goes back to the previous video, the player downloads the file again to play that. How to cache videos to users dont need to download videos again like Instagram?

I tried with cached_video_player and better_player and tested on an ios simulator. cache ability does not work on that. Also, I wanted to try to download videos with Dio but in this way user must wait to video full downloading and then can see videos, but I don't want that. So can you give me some advice?

E.Benedos
  • 1,585
  • 14
  • 41
  • Can you share details of your implementation using better_player. It supports caching. Another option you may try is manually downloading and storing the video locally while simultaneously streaming the video for the first time. If downloaded or is available in your cache play from that. – Su Mit Jul 05 '23 at 13:07
  • @SuMit This plugin is a bit old. When I add to my dependencies, I get a conflicting error with another version of the dependencies. In order to install the playe_better, I had to downgrade some of them. So after testing I removed that and get back to my main structure with video_player. If you can cache videos with better_player in ios, can you give me a sample? – Sajjad Javadi Jul 05 '23 at 17:26
  • https://github.com/SuTechs/cache_demo/ This is a demo for caching anything. I'd used video player fork. – Su Mit Jul 07 '23 at 04:39
  • @SuMit You work with this now? It's from 3 years ago, doesn't support null safely, and uses deprecated dependencies. – Sajjad Javadi Jul 07 '23 at 12:42
  • @SuMit I try to edit codes and modify for null safely, but I figured out this library doesn't support HTTP headers... – Sajjad Javadi Jul 07 '23 at 13:56
  • No, I was sharing the demo code of the implementation. You may do similar implementation. Or else you may always choose the second option of downloading and streaming at the same time once and after play from cache. – Su Mit Jul 08 '23 at 13:05

0 Answers0