
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
Execute a script each time the playback rate changes in HTML?
Use the onratechange attribute to execute a script each time the playback rate changes in HTML in HTML.
Example
You can try to run the following code to implement onratechange attribute −
<!DOCTYPE html> <html> <body> <video id = "myid" width = "320" height = "176" controls onratechange = "display()"> <source src = "/html5/foo.ogg" type = "video/ogg" /> <source src = "/html5/foo.mp4" type = "video/mp4" /> Your browser does not support the video element. </video> <p id="test">Change the speed of the video</p> <input type = "range" min = "0.1" max = "3" step = "0.2" value = "1"oninput = "update(this)"> <script> function display() { document.getElementById("test").innerHTML = "Speed: " + document.getElementById("myid").playbackRate; } function update(ob) { document.getElementById("myid").playbackRate = ob.value; } </script> </body> </html>
Output
- Related Articles
- Execute a script when the playback position of the media has changed in HTML?
- Execute a script when the cue changes in a element in HTML?
- Execute a script when the length of the media changes in HTML?
- Execute a script each time the volume of a video/audio is changed in HTML?
- Execute a script when the window's history changes in HTML?
- Execute a script when there have been changes to the anchor part of the URL in HTML?
- Execute a script when the file is unavailable in HTML?
- Execute a script when the element is invalid in HTML?
- Execute a script when the element loses focus in HTML?
- Execute a script before the document is printed in HTML?
- Execute a script after the document is printed in HTML?
- Execute a script when the element gets focus in HTML?
- Execute a script when an error occurs in HTML?
- Execute a script when a page has unloaded in HTML?
- Execute a script when the media has started playing in HTML?

Advertisements