Browse Source

Merge branch 'master' into stage-4

chenxiong 3 years ago
parent
commit
652a2e3a2e
1 changed files with 10 additions and 12 deletions
  1. 10 12
      pages3/polyv/detail.vue

+ 10 - 12
pages3/polyv/detail.vue

@@ -534,7 +534,7 @@ export default {
 				currentTime = polyvPlayerContext.getCurrentTime();
 			}
 			let self = this;
-			let photoIndex = self.photoIndex-1
+			let photoIndex = self.photoIndex
 			let data = {
 				photo: self.ossAvatarUrl,
 				sectionId: parseInt(self.playSectionId),
@@ -1095,28 +1095,26 @@ export default {
 			if (polyvPlayerContext != null) {
 				
 				this.playTime = polyvPlayerContext.getCurrentTime() //播放时刻
+				console.log(this.photoIndex,789)
 				//判断是否需要拍照
 				if (this.photoNum > 0) {
 					this.configPhoto()
-					if(this.photoIndex<this.photoList.length){
-						let photoTime = Number(this.photoList[this.photoIndex]); //获取拍照秒数
-						let nextIndex = this.photoIndex+1
-						let nextTime = 0
-						if(nextIndex<this.photoList.length){
-							nextTime = Number(this.photoList[nextIndex]); //获取下次拍照秒数
-						}
-						if (photoTime < this.playTime&&photoTime>this.playTime-4) { //3秒区间内才触发拍照,避免拉动滚动条 
-							if(this.photoHistoryList.indexOf(this.photoIndex)<0){ //不存在拍照历史则拍照
+					let photoTime =0; //获取拍照秒数
+					for(let i=0;i<this.photoList.length;i++){
+						photoTime = Number(this.photoList[i]); //获取拍照秒数
+						if (photoTime < this.playTime&&photoTime>this.playTime-4) { //3秒区间内才触发拍照,避免拉动滚动条
+							if(this.photoHistoryList.indexOf(i)<0){ //不存在拍照历史则拍照
 								//启动拍照
 								//暂停
 								polyvPlayerContext.exitFullScreen();
 								polyvPlayerContext.pause();
-								this.photoIndex++;
+								this.photoHistoryList.push(i)
+								this.photoIndex = i
 								this.openPhoto();
 								
+								
 							}
 							
-							
 						}
 					}