|
@@ -251,7 +251,8 @@ export default {
|
|
|
photoNum:0,
|
|
|
photoList:[], //拍照的时间点
|
|
|
photoConfig:false, //是否配置好拍照次数
|
|
|
- photoIndex:0 //当前位于拍照的区间下标 从0开始
|
|
|
+ photoIndex:0, //当前位于拍照的区间下标 从0开始
|
|
|
+ photoHistoryList:[], //已拍照历史的下标点
|
|
|
};
|
|
|
},
|
|
|
computed: { ...mapGetters(['userInfo', 'playSectionId','playChannelId','playVID']) },
|
|
@@ -421,7 +422,11 @@ export default {
|
|
|
gradeId: parseInt(self.gradeId)}
|
|
|
this.$api.getPhotoLastRecord(data).then(res => {
|
|
|
if(res.data.code==200){
|
|
|
- self.photoIndex = res.data.data //修改图片下标
|
|
|
+ self.photoHistoryList = []
|
|
|
+ for(let i=0;i<res.data.data.length;i++){
|
|
|
+ self.photoHistoryList.push(res.data.data[i].photoIndex)
|
|
|
+ }
|
|
|
+ console.log(self.photoHistoryList,789)
|
|
|
}
|
|
|
|
|
|
});
|
|
@@ -441,7 +446,7 @@ export default {
|
|
|
courseId: parseInt(self.courseId),
|
|
|
photoTime: parseInt(currentTime > 0 ? currentTime : 0),
|
|
|
gradeId: parseInt(self.gradeId),
|
|
|
- photoIndex: parseInt(self.photoIndex),
|
|
|
+ photoIndex: parseInt(self.photoIndex-1),//从0算起
|
|
|
photoNum:parseInt(self.photoNum)
|
|
|
};
|
|
|
console.log('提交接口', data);
|
|
@@ -462,6 +467,7 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
+ //配置随机拍照时间
|
|
|
configPhoto(){
|
|
|
var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
|
let totalVideoTime = polyvPlayerContext.getDuration()
|
|
@@ -491,7 +497,7 @@ export default {
|
|
|
//兼容已有观看历史
|
|
|
for(let i=0;i<this.photoList.length-1;i++){
|
|
|
if(this.photoList[i]<duration&&this.photoList[i+1]>duration){
|
|
|
- this.photoIndex = i
|
|
|
+ this.photoIndex = i+1
|
|
|
break
|
|
|
}
|
|
|
if(duration>this.photoList[this.photoList.length-1]){
|
|
@@ -499,7 +505,6 @@ export default {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
- console.log(this.photoIndex,"已o")
|
|
|
}
|
|
|
},
|
|
|
getLiveUid(channelId) {
|
|
@@ -977,12 +982,15 @@ export default {
|
|
|
nextTime = Number(this.photoList[nextIndex]); //获取下次拍照秒数
|
|
|
}
|
|
|
if (photoTime < this.playTime) {
|
|
|
- //启动拍照
|
|
|
- //暂停
|
|
|
- polyvPlayerContext.exitFullScreen();
|
|
|
- polyvPlayerContext.pause();
|
|
|
- this.openPhoto();
|
|
|
- this.photoIndex++;
|
|
|
+ if(this.photoHistoryListr.indexOf(this.photoIndex)<0){ //不存在拍照历史则拍照
|
|
|
+ //启动拍照
|
|
|
+ //暂停
|
|
|
+ polyvPlayerContext.exitFullScreen();
|
|
|
+ polyvPlayerContext.pause();
|
|
|
+ this.openPhoto();
|
|
|
+ this.photoIndex++;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
}
|