浏览代码

修复点击跳转对应时间

chenxiong 3 年之前
父节点
当前提交
0f69601b3d
共有 1 个文件被更改,包括 10 次插入6 次删除
  1. 10 6
      pages3/polyv/detail.vue

+ 10 - 6
pages3/polyv/detail.vue

@@ -297,7 +297,8 @@ export default {
 			let item = {
 				sectionId:Number(option.sectionId),
 				recordingUrl:option.recordingUrl,
-				noteSecond:noteSecond
+				noteSecond:noteSecond,
+				studyDuration:noteSecond
 			}
 			this.$store.commit('setPlaySectionId', {playSectionId  :item.sectionId});
 			this.$store.commit('setPlayVID', {playVID  :item.recordingUrl});
@@ -925,7 +926,7 @@ export default {
 		},
 		//播放笔记视频
 		async playNoteVideo(item) {
-			console.log(item)
+			console.log(item,'noteItem')
 			if (this.timer) {
 				clearInterval(this.timer);
 			}
@@ -937,11 +938,10 @@ export default {
 				this.vid = item.recordingUrl;
 			}
 			this.recordObj = {videoCurrentTime:item.noteSecond}
-			if (this.recordObj.studyDuration) {
+			if (this.recordObj.videoCurrentTime) {
 				this.needSeek = true; //需要跳转到播放记录
 			}
 			this.startStatus = true;
-		
 			//获取节笔记
 			this.getNoteList();
 		},
@@ -987,12 +987,15 @@ export default {
 			this.noteId = item.noteId;
 			//没视频播放
 			if(this.playSectionId==0){
-				this.$u.toast('即将跳到笔记位置');  
+				console.log('即将跳到笔记位置1')
+				this.$u.toast('即将跳到笔记位置1');  
 				this.$store.commit('setPlaySectionId', {playSectionId  :item.sectionId});
+				this.$store.commit('setPlayVID', {playVID  :item.recordingUrl});
 				this.playNoteVideo(item);
 			}else{
 				//正在看当前笔记视频
-				this.$u.toast('即将跳到笔记位置');
+				console.log('即将跳到笔记位置2')
+				this.$u.toast('即将跳到笔记位置2');
 				//跳到笔记时刻
 				var polyvPlayerContext = this.selectComponent('#playerVideo');
 				polyvPlayerContext.seek(item.noteSecond);
@@ -1306,6 +1309,7 @@ export default {
 				if (this.needSeek) {  
 					var polyvPlayerContext = this.selectComponent('#playerVideo');
 					if(this.recordObj.videoCurrentTime){
+						console.log('seek')
 						polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
 					}else{
 						polyvPlayerContext.seek(1);//避免相同节继续播放