Commit bcf7c42d by kyle

试听课程以及未听的不保存轨迹

parent 5051ea4f
...@@ -474,18 +474,20 @@ ...@@ -474,18 +474,20 @@
}, },
// // 暂停播放 // // 暂停播放
async pause() { async pause() {
console.log('pause') if (this.courseInfo.status != 1){
this.isPauseFlag = true; console.log('pause')
if (this.timer) { this.isPauseFlag = true;
clearInterval(this.timer) if (this.timer) {
} clearInterval(this.timer)
const result = await this.saveVideoPlayback() }
if(result=='success' && this.newCourseInfo.fileId){ const result = await this.saveVideoPlayback()
console.log('新的课程要进行赋值查询了') if(result=='success' && this.newCourseInfo.fileId){
this.fileId = this.newCourseInfo.fileId; console.log('新的课程要进行赋值查询了')
this.courseInfo.packFileId = this.newCourseInfo.packFileId; this.fileId = this.newCourseInfo.fileId;
this.playbackId = null; this.courseInfo.packFileId = this.newCourseInfo.packFileId;
this.courseDetail(); this.playbackId = null;
this.courseDetail();
}
} }
}, },
timeupdate(e) { timeupdate(e) {
...@@ -574,10 +576,12 @@ ...@@ -574,10 +576,12 @@
this.videoContext = uni.createVideoContext('myVideo'); this.videoContext = uni.createVideoContext('myVideo');
}, },
onUnload() { onUnload() {
this.videoContext.pause(); if (this.courseInfo.status != 1 && this.viewTime!=0) {
this.saveVideoPlayback(); this.videoContext.pause();
if (this.timer) { this.saveVideoPlayback();
clearInterval(this.timer) if (this.timer) {
clearInterval(this.timer)
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment