|
@@ -2807,9 +2807,6 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
},
|
|
|
- // beforeDestroy() {
|
|
|
- // this.player.destroy();
|
|
|
- // },
|
|
|
async mounted() {
|
|
|
this.courseId = +this.$route.query.courseId || "";
|
|
|
this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
|
|
@@ -2864,6 +2861,7 @@ export default {
|
|
|
console.log("------");
|
|
|
this.studyRecordQueryLiveLast();
|
|
|
}
|
|
|
+ document.addEventListener('visibilitychange', this.pauseVideo)
|
|
|
// let noteSecond = this.$route.query.noteSecond;
|
|
|
// if (noteSecond > 0) {
|
|
|
// let item = {
|
|
@@ -2888,6 +2886,7 @@ export default {
|
|
|
clearInterval(this.answerTimer);
|
|
|
clearInterval(this.postTimer);
|
|
|
clearInterval(this.livingTimer);
|
|
|
+ document.removeEventListener('visibilitychange', this.pauseVideo)
|
|
|
try {
|
|
|
this.$msgbox.close();
|
|
|
} catch (err) {}
|
|
@@ -2910,6 +2909,11 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(["getCartCount"]),
|
|
|
+ pauseVideo() {
|
|
|
+ if (document.visibilityState === 'hidden') {
|
|
|
+ this.player && this.player.j2s_pauseVideo();
|
|
|
+ }
|
|
|
+ },
|
|
|
isLast(item) {
|
|
|
if (this.liveLast) {
|
|
|
let sectionASame =
|