fix action in player
This commit is contained in:
parent
ab406786c7
commit
89f37278aa
@ -17,7 +17,6 @@ audio.onvolumechange = () => store.commit('player/volume', audio.volume)
|
|||||||
export const player = {
|
export const player = {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {
|
state: {
|
||||||
action: null,
|
|
||||||
currentTime: null,
|
currentTime: null,
|
||||||
duration: null,
|
duration: null,
|
||||||
episode: null,
|
episode: null,
|
||||||
@ -28,7 +27,7 @@ export const player = {
|
|||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
action: (state, action) => {
|
action: (state, action) => {
|
||||||
state.action = action
|
state.episode.action = action
|
||||||
|
|
||||||
if (action && action.position) {
|
if (action && action.position) {
|
||||||
audio.currentTime = action.position
|
audio.currentTime = action.position
|
||||||
@ -48,6 +47,10 @@ export const player = {
|
|||||||
audio.src = episode.episodeUrl
|
audio.src = episode.episodeUrl
|
||||||
audio.load()
|
audio.load()
|
||||||
audio.play()
|
audio.play()
|
||||||
|
|
||||||
|
if (episode.action && episode.action.position) {
|
||||||
|
audio.currentTime = episode.action.position
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
state.loaded = false
|
state.loaded = false
|
||||||
state.podcastUrl = null
|
state.podcastUrl = null
|
||||||
|
Loading…
Reference in New Issue
Block a user