Merge pull request #48 from nikandlv/development

Playnext logic and pause/play button update
master
Nikan Dalvand 2019-08-02 23:58:12 +04:30 committed by GitHub
commit 6c32f373a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -99,7 +99,6 @@ export default {
this.wavesurfer.load(this.playerQueue[this.currentlyPlaying].stream)
let readyCounter = 0
this.wavesurfer.on('ready', () => {
console.log('ready')
readyCounter += 1
this.duration = formatSeconds(this.getDuration())
let map = this.wavesurfer.minimap.drawer.container
@ -110,6 +109,14 @@ export default {
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
}
})
let currentWidth = 0
let hoverStatus = false
let hoverWidth = '0px'