Use theplaybackRateproperty to set the current playback speed of audio/video. Through this attribute, thedefaultPlaybackRateattribute sets the default playback speed of audio/video.
You can try running the following code to change the playback speed of the video −
/* play video thrice as fast */ document.querySelector('video').defaultPlaybackRate = 3.0; document.querySelector('video').play();
Here’s how to play the video at twice the speed −
/* play video twice as fast */ document.querySelector('video').playbackRate = 2;
The above is the detailed content of How to change the playback speed of a video in HTML5?. For more information, please follow other related articles on the PHP Chinese website!