0

Is there a way to retrieve the length needed to be buffered before a HTML5 video start to play? And also retrieve how much was buffered?

I've seen that question HTML5 Video - Percentage Loaded?, but it applies to video after started playing.

1 Answers1

2

You can look at the buffered property. It returns a TimeRanges object. For more info, see here.

Donal
  • 31,121
  • 10
  • 63
  • 72
  • Thanks, this resolve the second part of my question, but I was yet unable to find how much is needed to be buffered before autoplay, or at least, if it is possible. – pedrocpneto Sep 11 '17 at 16:47
  • I am not sure if that is possible. The seekable property will also return a TimeRanges. That will indicate what parts of the video can be played without buffering. Some parts of the video can be played and some can be buffered. You may want to provide feed back to show which parts they are. See this link: https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/buffering_seeking_time_ranges – Donal Sep 11 '17 at 16:59