See #1060: register listening earlier, instead of at the end of the track
This commit is contained in:
parent
464010f046
commit
056948a1ba
|
@ -251,6 +251,8 @@ export default {
|
||||||
progressInterval: null,
|
progressInterval: null,
|
||||||
maxPreloaded: 3,
|
maxPreloaded: 3,
|
||||||
preloadDelay: 15,
|
preloadDelay: 15,
|
||||||
|
listenDelay: 15,
|
||||||
|
listeningRecorded: null,
|
||||||
soundsCache: [],
|
soundsCache: [],
|
||||||
soundId: null,
|
soundId: null,
|
||||||
playTimeout: null,
|
playTimeout: null,
|
||||||
|
@ -477,6 +479,13 @@ export default {
|
||||||
this.getSound(toPreload)
|
this.getSound(toPreload)
|
||||||
this.nextTrackPreloaded = true
|
this.nextTrackPreloaded = true
|
||||||
}
|
}
|
||||||
|
if (t > this.listenDelay || d - t < 30) {
|
||||||
|
let onlyTrack = this.$store.state.queue.tracks.length === 1
|
||||||
|
if (this.listeningRecorded != this.currentTrack) {
|
||||||
|
this.listeningRecorded = this.currentTrack
|
||||||
|
this.$store.dispatch('player/trackListened', this.currentTrack)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
seek (step) {
|
seek (step) {
|
||||||
|
|
|
@ -127,7 +127,6 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
trackEnded ({dispatch, rootState}, track) {
|
trackEnded ({dispatch, rootState}, track) {
|
||||||
dispatch('trackListened', track)
|
|
||||||
let queueState = rootState.queue
|
let queueState = rootState.queue
|
||||||
if (queueState.currentIndex === queueState.tracks.length - 1) {
|
if (queueState.currentIndex === queueState.tracks.length - 1) {
|
||||||
// we've reached last track of queue, trigger a reload
|
// we've reached last track of queue, trigger a reload
|
||||||
|
|
Loading…
Reference in New Issue