THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

onratechange Event

Event Object Reference Event Object

Example

Execute a JavaScript when the playing speed of the video is changed:

<video onratechange="myFunction()">
Try it Yourself »

Definition and Usage

The onratechange event occurs when the playing speed of the audio/video is changed (like when a user switches to a slow motion or fast forward mode).

This event is invoked by the playbackRate property of the Audio/Video Object, which sets or returns the current playback speed of an audio/video.


Browser Support

The numbers in the table specify the first browser version that fully supports the 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: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions.


Technical Details

Bubbles: No
Cancelable: No
Event type: Event
Supported HTML tags: <audio> and <video>
DOM Version: Level 3 Events

Event Object Reference Event Object