From 23d25d25fabbb7fbb88562fe6dff41f56e286c55 Mon Sep 17 00:00:00 2001 From: Norbaev Date: Thu, 27 Jun 2024 11:10:07 +0500 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20initializationInfo?= =?UTF-8?q?=20-=20=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D1=8C=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8F=20isLoader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/player.vue | 23 ++++++++++++++++------- client/src/store/index.js | 1 + 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/client/src/components/player.vue b/client/src/components/player.vue index 6749bc8..d50d9a9 100644 --- a/client/src/components/player.vue +++ b/client/src/components/player.vue @@ -156,8 +156,8 @@ export default { }, }, created() { - this.connectionPlayer(); this.initializationInfo(); + this.connectionPlayer(); }, mounted() { this.$store.dispatch('initPlayer'); @@ -189,12 +189,20 @@ export default { } }, methods: { - async initializationInfo() { - return app.getNowplaying().then((responce) => { - console.log(responce.now_playing.song); - this.$store.dispatch('setCurrentPlay', responce.now_playing.song); - console.log(this.$store.state); - }); + initializationInfo() { + app + .getNowplaying() + .then((responce) => { + console.log(responce.now_playing.song); + this.$store.dispatch('setCurrentPlay', { + ...this.currentPlay, + isLoader: false, + ...responce.now_playing.song, + }); + console.log(this.player.target.src); + // console.log(this.$store.state); + }) + .catch((error) => console.log(error)); }, connectionPlayer() { @@ -237,6 +245,7 @@ export default { data.np.station.listen_url, ); this.$store.dispatch('changePlayer', data.np.station.listen_url); + console.log(this.player); const params = { ...this.currentPlay, ...data.np.now_playing.song, diff --git a/client/src/store/index.js b/client/src/store/index.js index 630528b..b8db9f2 100644 --- a/client/src/store/index.js +++ b/client/src/store/index.js @@ -93,6 +93,7 @@ export default createStore({ state.player.target.pause(); } if (params.play) { + console.log(state); if (state.player.target.readyState >= 3) { state.currentPlay.isPlay = true; state.player.target.play();