Skip to content
Snippets Groups Projects
Verified Commit e65606fd authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Throttle track progress for better performance

parent bb1cfd56
Branches
Tags
No related merge requests found
......@@ -19,7 +19,7 @@
import {mapState} from 'vuex'
import url from '@/utils/url'
import formats from '@/audio/formats'
import _ from 'lodash'
// import logger from '@/logging'
export default {
......@@ -98,11 +98,11 @@ export default {
}
}
},
updateProgress: function () {
updateProgress: _.throttle(function () {
if (this.$refs.audio) {
this.$store.dispatch('player/updateProgress', this.$refs.audio.currentTime)
}
},
}, 1000),
ended: function () {
if (this.looping === 1) {
this.setCurrentTime(0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment