Commit bcf7c42d by kyle

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

parent 5051ea4f
...@@ -474,6 +474,7 @@ ...@@ -474,6 +474,7 @@
}, },
// // 暂停播放 // // 暂停播放
async pause() { async pause() {
if (this.courseInfo.status != 1){
console.log('pause') console.log('pause')
this.isPauseFlag = true; this.isPauseFlag = true;
if (this.timer) { if (this.timer) {
...@@ -487,6 +488,7 @@ ...@@ -487,6 +488,7 @@
this.playbackId = null; this.playbackId = null;
this.courseDetail(); this.courseDetail();
} }
}
}, },
timeupdate(e) { timeupdate(e) {
this.totalTime = e.detail.duration; this.totalTime = e.detail.duration;
...@@ -574,6 +576,7 @@ ...@@ -574,6 +576,7 @@
this.videoContext = uni.createVideoContext('myVideo'); this.videoContext = uni.createVideoContext('myVideo');
}, },
onUnload() { onUnload() {
if (this.courseInfo.status != 1 && this.viewTime!=0) {
this.videoContext.pause(); this.videoContext.pause();
this.saveVideoPlayback(); this.saveVideoPlayback();
if (this.timer) { if (this.timer) {
...@@ -581,6 +584,7 @@ ...@@ -581,6 +584,7 @@
} }
} }
} }
}
</script> </script>
<style lang="scss"> <style lang="scss">
......
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