Added queu and play queue item action and mutation

pull/43/head
Nikan Dalvand 2019-08-01 23:07:21 +04:30
parent a39d404cc7
commit b5af578643
2 changed files with 19 additions and 9 deletions

View File

@ -33,7 +33,7 @@ export default {
}
</script>
<style lang="sass" scoped>
<style lang="sass">
section.action-bar
display: flex
align-items: center

View File

@ -1,28 +1,38 @@
const state = {
fullscreen_mode: false,
currently_playing: {
currently_playing: 0,
queue: [
{
id: 8,
title: 'Yellow',
artist: 'Rich Brian',
artwork: '/static/demo/yellow.jpeg',
stream: '/static/demo/music.mp3'
}
]
}
const getters = {
fullscreenStatus: (state) => state.fullscreen_mode,
currentlyPlaying: (state) => state.currently_playing
currentlyPlaying: (state) => state.currently_playing,
playerQueue: (state) => state.queue
}
const mutations = {
TOGGLE_FULLSCREEN (state) {
state.fullscreen_mode = !state.fullscreen_mode
},
PLAY_QUEUE_ITEM (state, index) {
state.currently_playing = index
}
}
const actions = {
toggleFullscreenStatus ({ commit }) {
commit('TOGGLE_FULLSCREEN')
},
playQueueItem ({ commit }, index) {
commit('PLAY_QUEUE_ITEM', index)
}
}