Przeglądaj źródła

Merge branch 'master' into stage-4

chenxiong 3 lat temu
rodzic
commit
02efbece78
2 zmienionych plików z 20 dodań i 9 usunięć
  1. 2 2
      components/course/courseSection.vue
  2. 18 7
      pages3/polyv/detail.vue

+ 2 - 2
components/course/courseSection.vue

@@ -150,10 +150,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

@@ -420,12 +420,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()
@@ -587,7 +594,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,"随机拍照时间数组")
@@ -780,10 +787,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;
 			
 			//获取节笔记
@@ -1096,7 +1102,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){ //不存在拍照历史则拍照
 								//启动拍照
 								//暂停
@@ -1116,9 +1122,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;
 				}