|
...
|
...
|
@@ -47,6 +47,8 @@ Vue.use(VideoPlayer) |
|
|
|
saveCurrentTime:'', // 当前播放进度时长
|
|
|
|
isShowSubs: false,
|
|
|
|
recodrTime :null,
|
|
|
|
lastPausedTime: 0,
|
|
|
|
pauseInterval: 10, // 每隔10秒暂停一次
|
|
|
|
playerOptions:{
|
|
|
|
playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
|
|
|
|
autoplay: false, //如果true,浏览器准备好时开始回放。
|
|
...
|
...
|
@@ -92,6 +94,18 @@ Vue.use(VideoPlayer) |
|
|
|
this.currentTime = item.cache_.currentTime
|
|
|
|
this.progress = ((this.currentTime.toFixed(2) / item.cache_.duration.toFixed(2)) * 100).toFixed(2) + '%'
|
|
|
|
// console.log('当前播放进度', item)
|
|
|
|
// 检查是否需要暂停
|
|
|
|
if (this.currentTime - this.lastPausedTime >= this.pauseInterval) {
|
|
|
|
let hh=this.$refs.videoPlayer.player; // 暂停视频播放
|
|
|
|
hh.pause()
|
|
|
|
this.lastPausedTime = this.currentTime; // 更新上次暂停的时间
|
|
|
|
}
|
|
|
|
|
|
|
|
// 检查视频是否播放完毕
|
|
|
|
if (this.currentTime >= item.cache_.duration) {
|
|
|
|
// 如果视频播放完毕,重置状态以便下一次播放
|
|
|
|
this.lastPausedTime = 0; // 重置上次暂停的时间
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 正在拖动
|
|
|
|
videoSeeking(item) {
|
|
...
|
...
|
@@ -195,6 +209,9 @@ Vue.use(VideoPlayer) |
|
|
|
background-color: #f7f9fc !important;
|
|
|
|
/* background-color: #d7e4f7 !important; */
|
|
|
|
}
|
|
|
|
.vjs-progress-control{
|
|
|
|
pointer-events: none !important;
|
|
|
|
}
|
|
|
|
.vjs-custom-skin > .video-js .vjs-big-play-button {
|
|
|
|
width: 70px;
|
|
|
|
border-radius: 50%;
|
...
|
...
|
|