|
@@ -501,15 +501,24 @@ export default {
|
|
|
//清空历史数据
|
|
|
self.photoHistoryList = []
|
|
|
this.photoIndex = 0
|
|
|
+ self.photoList = []
|
|
|
for(let i=0;i<res.data.data.length;i++){
|
|
|
- self.photoHistoryList.push(res.data.data[i].photoIndex)
|
|
|
+ //-2存储随机拍照数组
|
|
|
+ if(res.data.data[i].photoIndex==-2){
|
|
|
+ self.photoList = res.data.data[i].timeInterval.split(',')
|
|
|
+ }else{
|
|
|
+ self.photoHistoryList.push(res.data.data[i].photoIndex)
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
- postCoursePhotoRecord() {
|
|
|
+ //postTime 只提交随机时间
|
|
|
+ postCoursePhotoRecord(postTime=false) {
|
|
|
let currentTime = 0;
|
|
|
var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
|
if (polyvPlayerContext) {
|
|
@@ -524,10 +533,11 @@ export default {
|
|
|
courseId: parseInt(self.courseId),
|
|
|
photoTime: parseInt(currentTime > 0 ? currentTime : 0),
|
|
|
gradeId: parseInt(self.gradeId),
|
|
|
- photoIndex: parseInt(photoIndex),//从0算起
|
|
|
+ photoIndex: postTime?-2:parseInt(photoIndex),//从0算起,-2只提交随机时间
|
|
|
photoNum:parseInt(self.photoNum),
|
|
|
chapterId: parseInt(self.chapterId),
|
|
|
moduleId: parseInt(self.moduleId),
|
|
|
+ timeInterval: postTime?self.photoList.join(','):''
|
|
|
};
|
|
|
console.log('提交接口', data);
|
|
|
this.$api.coursePhotoRecord(data).then(res => {
|
|
@@ -564,17 +574,21 @@ export default {
|
|
|
spaceTime = totalVideoTime
|
|
|
}
|
|
|
let initSpace = 0
|
|
|
- this.photoList = []
|
|
|
- for(let i=0;i<this.photoNum;i++){
|
|
|
- let s = this.randomNum(initSpace,initSpace+spaceTime)
|
|
|
- if(s>totalVideoTime){
|
|
|
- s = totalVideoTime-1
|
|
|
- }
|
|
|
- if(s<2){
|
|
|
- s =1
|
|
|
+ //没有历史拍照间隔数据
|
|
|
+ if(this.photoList.length==0){
|
|
|
+ for(let i=0;i<this.photoNum;i++){
|
|
|
+ let s = this.randomNum(initSpace,initSpace+spaceTime)
|
|
|
+ if(s>totalVideoTime){
|
|
|
+ s = totalVideoTime-1
|
|
|
+ }
|
|
|
+ if(s<2){
|
|
|
+ s =1
|
|
|
+ }
|
|
|
+ this.photoList.push(s)
|
|
|
+ initSpace+=spaceTime
|
|
|
}
|
|
|
- this.photoList.push(s)
|
|
|
- initSpace+=spaceTime
|
|
|
+ console.log(this.photoList,"随机拍照时间数组11")
|
|
|
+ this.postCoursePhotoRecord(true)//提交随机拍照时间数组
|
|
|
}
|
|
|
console.log(this.photoList,"随机拍照时间数组")
|
|
|
//兼容已有观看历史
|
|
@@ -745,7 +759,7 @@ export default {
|
|
|
} else {
|
|
|
this.vid = item.recordingUrl;
|
|
|
}
|
|
|
- this.recordObj = {studyDuration:item.noteSecond}
|
|
|
+ this.recordObj = {videoCurrentTime:item.noteSecond}
|
|
|
if (this.recordObj.studyDuration) {
|
|
|
this.needSeek = true; //需要跳转到播放记录
|
|
|
}
|
|
@@ -1104,7 +1118,7 @@ export default {
|
|
|
if (newstate.detail.newstate == 'playing') {
|
|
|
if (this.needSeek) {
|
|
|
var polyvPlayerContext = this.selectComponent('#playerVideo');
|
|
|
- polyvPlayerContext.seek(this.recordObj.studyDuration);
|
|
|
+ polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
|
|
|
polyvPlayerContext.play();
|
|
|
this.needSeek = false;
|
|
|
}
|