if(!isDrag) {
var isMousedown = false;
videoPlayer.on('pause', function() {
if(isMousedown == false) {
oldTime = videoPlayer.currentTime();
}
});
videoPlayer.on('play', function() {
isMousedown = false;
newTime = videoPlayer.currentTime();
if(newTime < maxTime) {
videoPlayer.currentTime(newTime);
} else {
videoPlayer.currentTime(oldTime);
};
});
$(".vjs-progress-holder").mousedown(function() {
isMousedown = true;
oldTime = videoPlayer.getCache().currentTime;
});
videoPlayer.on('timeupdate', function() {
if(videoPlayer.currentTime() > maxTime && !isMousedown) {
maxTime = videoPlayer.currentTime();
}
});
}
转载于:https://www.cnblogs.com/duanyuanyuan/p/8317543.html