解决网页视频播放器进度条禁止拖动

本文转自:https://blog.csdn.net/weixin_46435234/article/details/114437203

1.点击键盘F12键,进入开发者模式

2.发现标志,html5播放器,属于原生支持最方便实现加速的

3.在开发者模式中找到Console 调式窗口,输入以下代码 可以设置视频播放速度

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
/* play video twice as fast */
document.

querySelector('video').defaultPlaybackRate = 1.0;//默认一倍速播放
document.querySele

ctor('video').play();

/* now play three times as fast just for the heck of it */

document.querySelector('video').playbackRate = 10.0;  //修改此值设置当前的播放倍数

4.直接跳过视频:

1
2
3
4
5
6
7
8
9
function skip() {
    
    let video = document.getElementsByTagName('video')
    for (let i=0; i<video.length; i++) {
    
        video[i].currentTime = video[i].duration
    }
}
setInterval(skip,200)
编辑此页 | #26a215e
最近更新:--| #94075f7
使用 Hugo 构建 | 主题 StackJimmy 设计