4

I am trying to developed VideoFeed screen where user can view the number of video one by one.

I have used flatlist to render the video and used react-native-video library to play vide.

In android I have used ExoPlayer to play the video.

I am using HLS(.m3u8) url to play video, but it takes time to loading not too much but when I compare to TikTok or Facebook Story, then their's video load too fast.

How can I load the vide fast in my app.

I am using this bufferconfig to get least buffer for video but nothing get help me.

const bufferConfig = {
  minBufferMs: 100,
  maxBufferMs: 200,
  bufferForPlaybackMs: 100,
  bufferForPlaybackAfterRebufferMs: 100
};

I am stuck at this point from last couple of days.

Please anyone helps me.

Pankaj Sonava
  • 519
  • 4
  • 20
  • You should `pre-cache` the videos. If the user is watching video `1`, preload & cache the next `2/3` videos so that the loading can be decreased. ExoPlayer has support for this via a `CacheWriter`. – Darshan Sep 23 '22 at 08:35
  • you need to cache the videos based on current index also you will need to clear previous cache other wise your application will 100 percent crash since flatlist renders a new object evertime,i would also recommend you to use recyclelistview – Abd Sep 23 '22 at 08:37
  • if you models doesn't support caching you should download the videos into cache – Abd Sep 23 '22 at 08:40
  • Guys @DarShan , Abd, Is there any proper way to cache video in react native. As I am using HLS and default caching system not support HLS video – Pankaj Sonava Sep 23 '22 at 08:54

0 Answers0