Partially implemented next/previous buttons

pull/45/head
Nikan Dalvand 2019-08-02 00:41:46 +04:30
parent c7c9ef5184
commit 43d2f9d15d
3 changed files with 83 additions and 76 deletions

View File

@ -63,7 +63,10 @@ export default {
},
computed: mapGetters(['fullscreenStatus', 'currentlyPlaying', 'playerQueue']),
mounted () {
console.log(this.currentlyPlaying)
this.drawVisualizer()
},
methods: {
drawVisualizer () {
let progress = this.$el.getElementsByClassName('progress')[0]
this.wavesurfer = WaveSurfer.create({
container: '#visualizer',
@ -133,7 +136,6 @@ export default {
currentWidth = progressWave.style.width
})
},
methods: {
onArtworkLoad () {
let img = this.$el.getElementsByTagName('img')[0]
let controlIcons = this.$el.getElementsByClassName('control-buttons')[0].children
@ -167,9 +169,11 @@ export default {
},
playNext () {
this.playQueueItem(this.currentlyPlaying + 1)
this.wavesurfer.load(this.playerQueue[this.currentlyPlaying].stream)
},
playPrevious () {
this.playQueueItem(this.currentlyPlaying - 1)
this.wavesurfer.load(this.playerQueue[this.currentlyPlaying].stream)
},
play () {
this.wavesurfer.play()

View File

@ -2,11 +2,14 @@ import Vue from 'vue'
import Vuex from 'vuex'
import { createPersistedState, createSharedMutations } from 'vuex-electron'
import Store from 'electron-store'
import modules from './modules'
let clear = false
if (clear) {
const store = new Store({ name: 'vuex' })
store.clear()
}
Vue.use(Vuex)
export default new Vuex.Store({
modules,
plugins: [

View File

@ -18,10 +18,10 @@ const state = {
},
{
id: 8,
title: 'Yellow',
artist: 'Rich Brian',
artwork: '/static/demo/clever.jpg',
stream: '/static/demo/music.mp3'
title: 'Ali sorena',
artist: 'Negar',
artwork: 'http://sakhamusic.ir/wp-content/uploads/2016/03/Ali-Sorena-%E2%80%93-Negar.jpg',
stream: 'http://dl.sakhamusic.ir/94/esfand/09/03%20Negar%20(Prod.%20Ehsan%20Ziya)_2.mp3'
}
]
}