3

I am trying to show a progress bar, just like in any video.

Start -------O------------------ END

I am using React Native Video to embed video content into my app.

So far I came up with the following method:

This library comes with a method to know the current time of video. Since I know the full length of the video in seconds (e.g. 50 seconds), I call onProgess() method which allows me to extract the current time in seconds e.g. 20 seconds.

This allows me to build some UI to show 20/50 ~ 40% has been completed.

However, the downside is that I re-render the content 20 times per second (by constantly calling onProgress), and it just doesn't feel like the correct way to solve the problem.

Can anyone tell me is rendering ~600 (and more) times per minute is actually reasonable during video playback?

GRS
  • 2,807
  • 4
  • 34
  • 72

0 Answers0