HTML Audio/Video DOM ratechange Event
The ratechange event is triggered when the playback rate of an audio/video changes (such as when the user switches to slow motion or fast forward mode).
Note: This event is invoked by the defaultPlaybackRate property or the playbackRate property of the Audio/Video object.
Browser Support
The numbers in the table indicate the first browser version that fully supports this event.
| Event | |||||
|---|---|---|---|---|---|
| ratechange | Yes | 9.0 | Yes | Yes | Yes |
Grammar
In HTML:
In JavaScript:
In JavaScript, use the addEventListener() method:
Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions.
Technical Details
| Supported HTML tags: | <audio> and <video> |
|---|---|
| Supported JavaScript objects: | Audio, Video |
More Examples
The following example demonstrates how to use the onratechange event. When the user changes the video playback speed, the alert() function is triggered to display an alert box.
Video courtesy of Big Buck Bunny.
Related Pages
HTML DOM Reference: ratechange Event
YouTip