How to change the playing speed of videos in HTML5?

HTMLWeb DevelopmentFront End Technology

Use the playbackRate property sets the current playback speed of the audio/video. With that, the defaultPlaybackRate property sets the default playback speed of the audio/video.

You can try to run the following code to change the playing speed of videos −

/* play video thrice as fast */
document.querySelector('video').defaultPlaybackRate = 3.0;
document.querySelector('video').play();

The following is to play the video twice as fast −

/* play video twice as fast */
document.querySelector('video').playbackRate = 2;
raja
Published on 20-Mar-2018 11:27:58
Advertisements