devcshort / react-hls

Simple React component for playing hls/rtmp live streams.
https://www.npmjs.com/package/react-hls-player
MIT License
118 stars 48 forks source link

Listen to video buffer data #35

Open fernando140alto opened 2 years ago

fernando140alto commented 2 years ago

I'm currently using a listener to check if there's enough buffer like so:

      if (targetRef.readyState > targetRef.HAVE_FUTURE_DATA) {
        keepPlaying();
      } else { stopPlaying(); }

However this property willl only listen to audio data and not video data.

Audio is being buffered before video causing audio to keep playing without video.

Is it a way to listen the current video buffer data?

Thanks for the great work with the package!