天天看点

浏览器倍速播放本地视频

原文:https://www.cnblogs.com/Amy-world/p/12867922.html

html5播放器

主要标志是

<video>

,这种是最方便实现加速的,因为原生支持.

主要依靠这两个属性:

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

可以自己在console中修改实现

/* 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; //修改此值设置当前的播放倍数
           

继续阅读