From 8248073a4d45886767e67a3b0ed24e1e8c289fca Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Mon, 18 Sep 2023 17:41:42 +0200 Subject: [PATCH] prepare the intervals --- src/components/Player.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index 01e1d44..fbbbd8f 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -65,9 +65,12 @@ export default { this.audio.play(); }, pause() { - if (!this.audio.paused) { - this.audio.pause(); - } + this.audio.pause(); + + window.clearInterval(this.intervalProgress); + window.clearInterval(this.intervalHistory); + + this.progress = this.audio.currentTime; }, durationChanged() { this.duration = this.audio.duration; @@ -180,7 +183,7 @@ export default { return; } if (!this.audio.paused) { - this.audio.pause(); + this.pause(); } else if (this.audio.src != "") { this.audio.play(); }