修改视频播放拖拽问题

This commit is contained in:
sunhonglai
2025-03-31 19:13:55 +08:00
parent 0989360183
commit d01fd6f07b
2 changed files with 17 additions and 2 deletions

View File

@@ -506,6 +506,15 @@ export default {
updateProgressBySetTime(newCurrentTime) { updateProgressBySetTime(newCurrentTime) {
this.currentProgress = newCurrentTime / this.videoDom.duration; this.currentProgress = newCurrentTime / this.videoDom.duration;
}, },
/* 点击进度条更新视频播放进度2
*/
updateProgressByClickBar2(newCurrentTime,progressVideo) {
console.log('=======progressVideo:'+progressVideo)
this.currentProgress = progressVideo;
this.barrageTimelineStart = newCurrentTime;
console.log('=======newCurrentTime:'+newCurrentTime)
this.videoDom.currentTime = newCurrentTime;
},
/* 提高视频音量 /* 提高视频音量
*/ */
increaseVolume() { increaseVolume() {
@@ -619,7 +628,7 @@ export default {
handleFullscreenChange() { handleFullscreenChange() {
console.log("handleFullscreenChange gx this.isFullScreen()",this.isFullScreen()) console.log("handleFullscreenChange gx this.isFullScreen()",this.isFullScreen())
console.log("handleFullscreenChange gx this.isFullscreen",this.isFullscreen) console.log("handleFullscreenChange gx this.isFullscreen",this.isFullscreen)
if(this.isFullscreen){ if(this.isFullscreen){
this.isFullscreen = !!document.fullscreenElement; this.isFullscreen = !!document.fullscreenElement;
if (!this.isFullscreen) { if (!this.isFullscreen) {
@@ -629,7 +638,7 @@ export default {
} }
} }
} }
}, },
watch: { watch: {

View File

@@ -802,6 +802,11 @@
this.$nextTick(function(){ this.$nextTick(function(){
if(this.contentData.progressVideo){
this.$refs.myVideoPlayer.updateProgressByClickBar2(this.contentData.lastStudyTime,this.contentData.progressVideo);
// $this.notePlay = this.contentData.lastStudyTime;
}
//let h0=document.getElementById('id_course_player').offsetHeight; //let h0=document.getElementById('id_course_player').offsetHeight;
let h=$this.$refs.coursePlayer.offsetHeight; let h=$this.$refs.coursePlayer.offsetHeight;
//let h1=$this.$refs.coursePlayer.clientHeight; //let h1=$this.$refs.coursePlayer.clientHeight;
@@ -1448,6 +1453,7 @@
} }
//console.log(scon.contentId,con.id); //console.log(scon.contentId,con.id);
con.lastStudyTime = scon.lastStudyTime; con.lastStudyTime = scon.lastStudyTime;
con.progressVideo = scon.progressVideo;
//以下判断是为了兼容之前的问题,学习状态 //以下判断是为了兼容之前的问题,学习状态
if (scon.status) { if (scon.status) {
con.status = scon.status; con.status = scon.status;