Assign an "onratechange" event to a video element.
Use the playbackRate property to change the speed of the video: