he2802 3 жил өмнө
parent
commit
9c31be48c3

+ 2 - 2
components/course/courseSection.vue

@@ -144,10 +144,10 @@ export default {
 						icon: 'error'
 					});
 				}
-				if(this.playSectionId==this.newId){
+				/* if(this.playSectionId==this.newId){
 					//切换为同一节
 					return
-				}
+				} */
 				if(this.playSectionId>0){
 					//切换视频
 					let oldSectionId = this.playSectionId

+ 18 - 7
pages3/polyv/detail.vue

@@ -390,12 +390,19 @@ export default {
 	mounted() {
 		uni.$on('changeSection', oldSectionId => {
 			console.log(this.playVID)
+			this.photoConfig = false
+			var polyvPlayerContext = this.selectComponent('#playerVideo');
+			if(polyvPlayerContext){
+				//解决同个节视频切换问题
+				polyvPlayerContext.pause();
+			}
 			//清除直播
 			this.$store.commit('setPlayChannelId', { playChannelId: 0 });
 			this.postStudyRecord(0, oldSectionId);
 		});
 		uni.$on('getSection', item => {
 			//清除直播
+			this.photoConfig = false
 			this.$store.commit('setPlayChannelId', { playChannelId: 0 });
 			//获取拍照历史
 			this.getPhotoLastRecord()
@@ -523,7 +530,7 @@ export default {
 						this.photoList.push(s)
 						initSpace+=spaceTime
 					}
-					console.log(this.photoList,"随机拍照时间数组11")
+					console.log(this.photoList,"随机拍照时间数组11",this.photoNum,initSpace,spaceTime)
 					this.postCoursePhotoRecord(true)//提交随机拍照时间数组
 				}
 				console.log(this.photoList,"随机拍照时间数组")
@@ -716,10 +723,9 @@ export default {
 			} else {
 				this.vid = item.recordingUrl;
 			}
+			this.recordObj = null
 			this.recordObj = await this.getRecordLast();
-			if (this.recordObj.studyDuration) {
-				this.needSeek = true; //需要跳转到播放记录
-			}
+			this.needSeek = true; //跳转到播放记录
 			this.startStatus = true;
 			
 			//获取节笔记
@@ -1028,7 +1034,7 @@ export default {
 						if(nextIndex<this.photoList.length){
 							nextTime = Number(this.photoList[nextIndex]); //获取下次拍照秒数
 						}
-						if (photoTime < this.playTime&&photoTime>this.playTime-3) { //3秒区间内才触发拍照,避免拉动滚动条 
+						if (photoTime < this.playTime&&photoTime>this.playTime-4) { //3秒区间内才触发拍照,避免拉动滚动条 
 							if(this.photoHistoryList.indexOf(this.photoIndex)<0){ //不存在拍照历史则拍照
 								//启动拍照
 								//暂停
@@ -1048,9 +1054,14 @@ export default {
 		},
 		onStateChange(newstate, oldstate) {
 			if (newstate.detail.newstate == 'playing') {
-				if (this.needSeek) {   
+				if (this.needSeek) {  
 					var polyvPlayerContext = this.selectComponent('#playerVideo');
-					polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
+					if(this.recordObj.videoCurrentTime){
+						polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
+					}else{
+						polyvPlayerContext.seek(1);//避免相同节继续播放
+					}
+					
 					polyvPlayerContext.play();
 					this.needSeek = false;
 				}