对于 HTML5 播放器,设置 <video> 属性:
/* play video twice as fast */ document.querySelector('video').defaultPlaybackRate = 2.0; document.querySelector('video').play(); /* now play three times as fast just for the heck of it */ document.querySelector('video').playbackRate = 3.0;
defaultPlaybackRate* (float): The playback speed at which the video should be played
playbackRate* (float): The current playback speed: 1.0 is normal, 2.0 is two times faster forward, -3.0 is three times faster backwards and so on
参考文献