onprogressEvent

事件对象参考手册Event Object

Example

Execute JavaScript when the video is downloading:

<video onprogress="myFunction()">

Try it Yourself »

More examples are included at the bottom of this article.


Definition and Usage

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

During the download of video/audio (audio/video), the events are triggered in the following order:

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

Browser Support

The numbers in the table indicate the first browser version that supports this event.

Event
onprogress Yes 9.0 Yes Yes Yes


Syntax

In HTML:

<element onprogress="myScript">Try it Yourself

In JavaScript:

object.onprogress=function(){myScript};Try it Yourself

In JavaScript, using the addEventListener() method:

object.addEventListener("progress", myScript);Try it Yourself

Note:Internet Explorer 8 and earlier IE versions do not supportaddEventListener()method.


Technical Details
Does it support bubbling: No
Can it be cancelled: No
Event type: Event
Supported HTML tags: <audio>, <video>


Examples

More Examples

Example

Execute JavaScript when the audio is downloading:

<audio onprogress="myFunction()">

Try it Yourself »


事件对象参考手册Event Object Other Extensions