Added queu and play queue item action and mutation
parent
a39d404cc7
commit
b5af578643
|
|
@ -33,7 +33,7 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
<style lang="sass">
|
||||
section.action-bar
|
||||
display: flex
|
||||
align-items: center
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue