From 89f37278aa84273f90fade1206a32829bba5e9ea Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Tue, 29 Aug 2023 12:07:23 +0200 Subject: [PATCH] fix action in player --- src/store/player.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/store/player.js b/src/store/player.js index 7a7c458..6dc8905 100644 --- a/src/store/player.js +++ b/src/store/player.js @@ -17,7 +17,6 @@ audio.onvolumechange = () => store.commit('player/volume', audio.volume) export const player = { namespaced: true, state: { - action: null, currentTime: null, duration: null, episode: null, @@ -28,7 +27,7 @@ export const player = { }, mutations: { action: (state, action) => { - state.action = action + state.episode.action = action if (action && action.position) { audio.currentTime = action.position @@ -48,6 +47,10 @@ export const player = { audio.src = episode.episodeUrl audio.load() audio.play() + + if (episode.action && episode.action.position) { + audio.currentTime = episode.action.position + } } else { state.loaded = false state.podcastUrl = null