Updated playerbar to consume correct queue

pull/43/head
Nikan Dalvand 2019-08-01 23:10:20 +04:30
parent b5af578643
commit b9ff59c712
1 changed files with 5 additions and 5 deletions

View File

@ -1,10 +1,10 @@
<template> <template>
<section> <section>
<section class="player"> <section class="player">
<img @load="onArtworkLoad" class="artwork" :src="currentlyPlaying.artwork" /> <img @load="onArtworkLoad" class="artwork" :src="playerQueue[this.currentlyPlaying].artwork" />
<div> <div>
<p class="title">{{currentlyPlaying.title}}</p> <p class="title">{{playerQueue[this.currentlyPlaying].title}}</p>
<p class="artist">{{currentlyPlaying.artist}}</p> <p class="artist">{{playerQueue[this.currentlyPlaying].artist}}</p>
</div> </div>
<div class="visualizer"> <div class="visualizer">
<div id="visualizer"></div> <div id="visualizer"></div>
@ -61,7 +61,7 @@ export default {
isFullscreen: false isFullscreen: false
} }
}, },
computed: mapGetters(['fullscreenStatus', 'currentlyPlaying']), computed: mapGetters(['fullscreenStatus', 'currentlyPlaying', 'playerQueue']),
mounted () { mounted () {
let progress = this.$el.getElementsByClassName('progress')[0] let progress = this.$el.getElementsByClassName('progress')[0]
this.wavesurfer = WaveSurfer.create({ this.wavesurfer = WaveSurfer.create({
@ -90,7 +90,7 @@ export default {
}) })
] ]
}) })
this.wavesurfer.load(this.currentlyPlaying.stream) this.wavesurfer.load(this.playerQueue[this.currentlyPlaying].stream)
this.wavesurfer.on('ready', () => { this.wavesurfer.on('ready', () => {
this.duration = formatSeconds(this.getDuration()) this.duration = formatSeconds(this.getDuration())
this.wavesurfer.container.style['height'] = '100%' this.wavesurfer.container.style['height'] = '100%'