kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Merge branch 'reset-queue-same-track' into 'develop'
Fixed position not being reseted properly when playing the same track multiple times in a row See merge request funkwhale/funkwhale!90merge-requests/154/head
commit
f65828762e
|
@ -0,0 +1 @@
|
|||
Fixed position not being reseted properly when playing the same track multiple times in a row
|
|
@ -3,7 +3,7 @@
|
|||
<div class="player">
|
||||
<audio-track
|
||||
ref="currentAudio"
|
||||
v-if="currentTrack"
|
||||
v-if="renderAudio && currentTrack"
|
||||
:key="(currentIndex, currentTrack.id)"
|
||||
:is-current="true"
|
||||
:start-time="$store.state.player.currentTime"
|
||||
|
@ -151,6 +151,7 @@ export default {
|
|||
data () {
|
||||
let defaultAmbiantColors = [[46, 46, 46], [46, 46, 46], [46, 46, 46], [46, 46, 46]]
|
||||
return {
|
||||
renderAudio: true,
|
||||
sliderVolume: this.volume,
|
||||
Track: Track,
|
||||
defaultAmbiantColors: defaultAmbiantColors,
|
||||
|
@ -163,7 +164,6 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
pause: 'player/pause',
|
||||
togglePlay: 'player/togglePlay',
|
||||
clean: 'queue/clean',
|
||||
next: 'queue/next',
|
||||
|
@ -230,6 +230,17 @@ export default {
|
|||
this.ambiantColors = this.defaultAmbiantColors
|
||||
}
|
||||
},
|
||||
currentIndex (newValue, oldValue) {
|
||||
if (newValue !== oldValue) {
|
||||
// why this? to ensure the audio tag is deleted and fully
|
||||
// rerendered, so we don't have any issues with cached position
|
||||
// or whatever
|
||||
this.renderAudio = false
|
||||
this.$nextTick(() => {
|
||||
this.renderAudio = true
|
||||
})
|
||||
}
|
||||
},
|
||||
volume (newValue) {
|
||||
this.sliderVolume = newValue
|
||||
},
|
||||
|
|
Ładowanie…
Reference in New Issue