2

I was making custom controls for the HTML 5 Audio. I need to show the buffered duration. The duration property gives the complete duration from the metadata, and the buffered property is the currently buffered duration. I need to update the buffered duration as it changes. Is there an event that triggers when buffered duration of media file changes?

1 Answer 1

2

It seems you are looking for the progress event.

Here is a description of all the events fired by media elements: http://www.w3.org/TR/html5/media-elements.html#mediaevents

2
  • Thanks @matthias.p ! That worked. I could not make that out from the description of the event.
    – Pranjal
    Commented Aug 15, 2012 at 12:34
  • It looks like at least in Firefox 93 and Chromium 94 this event sometimes fires before buffered has actually been updated. I'm seeing both seeked and progress fire and buffered after a seek, and buffered still being the same as what it was beforehand. The only reasonable thing I've found is to also update my UI on timeupdate.
    – tremby
    Commented Oct 22, 2021 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.