Added playnext first revision logic,Update the pause button when queue ends
parent
e29ba8eb33
commit
0bcbc33119
|
|
@ -98,8 +98,12 @@ export default {
|
||||||
})
|
})
|
||||||
this.wavesurfer.load(this.playerQueue[this.currentlyPlaying].stream)
|
this.wavesurfer.load(this.playerQueue[this.currentlyPlaying].stream)
|
||||||
let readyCounter = 0
|
let readyCounter = 0
|
||||||
|
let end = false
|
||||||
this.wavesurfer.on('ready', () => {
|
this.wavesurfer.on('ready', () => {
|
||||||
console.log('ready')
|
if (end) {
|
||||||
|
end = false
|
||||||
|
return
|
||||||
|
}
|
||||||
readyCounter += 1
|
readyCounter += 1
|
||||||
this.duration = formatSeconds(this.getDuration())
|
this.duration = formatSeconds(this.getDuration())
|
||||||
let map = this.wavesurfer.minimap.drawer.container
|
let map = this.wavesurfer.minimap.drawer.container
|
||||||
|
|
@ -110,6 +114,15 @@ export default {
|
||||||
this.playingStatus = this.isPlaying()
|
this.playingStatus = this.isPlaying()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.wavesurfer.on('finish', () => {
|
||||||
|
if (this.currentlyPlaying >= 0 && (this.currentlyPlaying + 1) !== this.playerQueue.length) {
|
||||||
|
this.playNext()
|
||||||
|
}
|
||||||
|
if (this.currentlyPlaying >= 0 && (this.currentlyPlaying + 1) === this.playerQueue.length) {
|
||||||
|
this.playingStatus = false
|
||||||
|
end = true
|
||||||
|
}
|
||||||
|
})
|
||||||
let currentWidth = 0
|
let currentWidth = 0
|
||||||
let hoverStatus = false
|
let hoverStatus = false
|
||||||
let hoverWidth = '0px'
|
let hoverWidth = '0px'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue