onprogress event

onprogress event The event object

JavaScript while the video is being downloaded:

<video onprogress="myFunction()">

Try it out . . .

More examples are included at the bottom of this article.


Definitions and usages

The onprogress event is triggered when the browser downloads the specified video/audio/video.

During the download of video/audio, the order in which events are triggered is as follows:

  1. onloadstart
  2. ondurationchange
  3. onloadedmetadata
  4. onloadeddata
  5. onprogress
  6. oncanplay
  7. oncanplaythrough

Browser support

The numbers in the table support the version number of the first browser for the event.

Event
onprogress Yes 9.0 Yes Yes Yes


Grammar

In HTML:

< element onprogress=" myScript "> Give it a try

In JavaScript:

object .onprogress=function(){ myScript }; Give it a try

In JavaScript, use the addEventListener() method:

object .addEventListener("progress", myScript ); Give it a try

Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions of IE.


Technical details
Whether to support bubbling: No
Can I cancel: No
Types of events: Event
Supported HTML tags: <audio>, <video>


onprogress event

More instances

JavaScript while audio is being downloaded:

<audio onprogress="myFunction()">

Try it out . . .


onprogress event The event object