1. 将加载条利用css隐藏
video::-webkit-media-controls-timeline {
display: none;
}
2. 利用js控制逻辑
useEffect(() => {
//关键代码开始
var sym: any;
var video: any = document.querySelector("video")
const timeout = setInterval(function () {
var time = video.currentTime
if (time - sym > 1) {
video.currentTime = sym
}
sym = video.currentTime
}, 0);
//true 允许快进 false 禁止快进
if (false) {
clearInterval(timeout)
}
// 关键代码结束
return () => {
clearInterval(timeout)
}
}, [])