time on seek
This commit is contained in:
parent
6cd97896c7
commit
50abff2f9d
@ -77,7 +77,19 @@ export const player = {
|
|||||||
},
|
},
|
||||||
pause: (context) => {
|
pause: (context) => {
|
||||||
audio.pause()
|
audio.pause()
|
||||||
axios.post(generateUrl('/apps/gpoddersync/episode_action/create'), [{
|
context.dispatch('time')
|
||||||
|
},
|
||||||
|
play: () => audio.play(),
|
||||||
|
seek: (context, currentTime) => {
|
||||||
|
audio.currentTime = currentTime
|
||||||
|
context.dispatch('time')
|
||||||
|
},
|
||||||
|
stop: (context) => {
|
||||||
|
context.dispatch('pause')
|
||||||
|
context.commit('episode', null)
|
||||||
|
context.commit('action', null)
|
||||||
|
},
|
||||||
|
time: async (context) => axios.post(generateUrl('/apps/gpoddersync/episode_action/create'), [{
|
||||||
podcast: context.state.podcastUrl,
|
podcast: context.state.podcastUrl,
|
||||||
episode: context.state.episode.episodeUrl,
|
episode: context.state.episode.episodeUrl,
|
||||||
guid: context.state.episode.episodeGuid,
|
guid: context.state.episode.episodeGuid,
|
||||||
@ -86,17 +98,7 @@ export const player = {
|
|||||||
started: Math.round(context.state.action ? context.state.action.started : 0),
|
started: Math.round(context.state.action ? context.state.action.started : 0),
|
||||||
position: Math.round(audio.currentTime),
|
position: Math.round(audio.currentTime),
|
||||||
total: Math.round(audio.duration),
|
total: Math.round(audio.duration),
|
||||||
}])
|
}]),
|
||||||
},
|
|
||||||
play: () => audio.play(),
|
|
||||||
seek: (context, currentTime) => {
|
|
||||||
audio.currentTime = currentTime
|
|
||||||
},
|
|
||||||
stop: (context) => {
|
|
||||||
context.dispatch('pause')
|
|
||||||
context.commit('episode', null)
|
|
||||||
context.commit('action', null)
|
|
||||||
},
|
|
||||||
volume: (context, volume) => {
|
volume: (context, volume) => {
|
||||||
audio.volume = volume
|
audio.volume = volume
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user