4

In Firefox, when I see the simple video element in this example, it has default browser controls. Right after the page is loaded the video starts to load; I see how the buffering (loading) line is moving to the right side of the default browser controls.

How can I get this value for the buffer?

I have tried a number of different ways, including video.buffered and progress event listener with e.total, e.loaded.

I have Firefox 3.6.3, which doesn't seem to support .buffered or .total / .loaded.

How do the default browser controls initialize this buffering progress?

By the way, I have other examples of different HTML5 players, which do the same as the default browser controls:

Kevin Brown-Silva
  • 40,873
  • 40
  • 203
  • 237
Nik Sumeiko
  • 8,263
  • 8
  • 50
  • 53

1 Answers1

8

View the source at this example :

http://people.mozilla.com/~cpearce/buffered-demo.html

Essentially, you need to get your control and check the "buffered" property of it.

var v = document.getElementById('buffered_v');
var r = v.buffered.end(0);

That should be your buffered value.

Ashot
  • 521
  • 2
  • 6
  • 15
Dominic Tancredi
  • 41,134
  • 7
  • 34
  • 50