mirror of https://github.com/VueTubeApp/VueTube
Revert "perf: ⚡ make watch page use less RAM"
This reverts commit 383e91cfe9
.
This commit is contained in:
parent
383e91cfe9
commit
5ff2bcbaa7
|
@ -22,15 +22,20 @@ export default {
|
|||
humanDuration: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
calcDuration() {
|
||||
this.humanDuration = this.$vuetube.humanTime(this.duration);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
//--- Only set video duration when 'this.duration' becomes defined ---//
|
||||
//--- Only call 'calcDuration()' when 'this.duration' becomes defined ---//
|
||||
const durationTimer = setInterval(() => {
|
||||
if (this.duration) {
|
||||
this.humanDuration = this.$vuetube.humanTime(this.duration);
|
||||
this.calcDuration();
|
||||
return clearInterval(durationTimer);
|
||||
}
|
||||
}, 100);
|
||||
//--- END Only set video duration when 'this.duration' becomes defined ---//
|
||||
//--- END Only call 'calcDuration()' when 'this.duration' becomes defined ---//
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue