onratechangeEvent
Example
Execute JavaScript when the video playback rate changes:
<video onratechange="myFunction()">
Try it yourself »
Definition and Usage
The onratechange event triggers when the playback rate of the audio/video changes.
This event is invoked through the Audio/Video object's playbackRateproperty, which is used to set or return the current playback rate of the audio/video.
Browser Support
The numbers in the table indicate the first browser version that supports this event.
| Event | |||||
|---|---|---|---|---|---|
| onratechange | Yes | 9.0 | Yes | Yes | Yes |
Syntax
In HTML:
<element onratechange="myScript">Try it yourself
In JavaScript:
object.onratechange=function(){myScript};Try it yourself
In JavaScript, using the addEventListener() method:
object.addEventListener("ratechange", myScript);Try it yourself
Note:Internet Explorer 8 and earlier IE versions do not supportaddEventListener()the method.
Technical Details
| Supports bubbling: | No |
|---|---|
| Can be cancelled: | No |
| Event type: | Event |
| Supported HTML tags: | <audio>, <video> |
Event Object Other Extensions