mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-31 15:19:34 +02:00
Update:Adjust current playback time with playback speed #549
This commit is contained in:
parent
55b7f05685
commit
99d60eaf9a
1 changed files with 7 additions and 8 deletions
|
@ -317,7 +317,7 @@ export default {
|
||||||
return this.$secondsToTimestamp(this.totalDuration)
|
return this.$secondsToTimestamp(this.totalDuration)
|
||||||
},
|
},
|
||||||
currentTimePretty() {
|
currentTimePretty() {
|
||||||
return this.$secondsToTimestamp(this.currentTime)
|
return this.$secondsToTimestamp(this.currentTime / this.currentPlaybackRate)
|
||||||
},
|
},
|
||||||
timeRemaining() {
|
timeRemaining() {
|
||||||
if (this.useChapterTrack && this.currentChapter) {
|
if (this.useChapterTrack && this.currentChapter) {
|
||||||
|
@ -452,6 +452,7 @@ export default {
|
||||||
await this.$hapticsImpact()
|
await this.$hapticsImpact()
|
||||||
console.log(`[AudioPlayer] Set Playback Rate: ${speed}`)
|
console.log(`[AudioPlayer] Set Playback Rate: ${speed}`)
|
||||||
this.currentPlaybackRate = speed
|
this.currentPlaybackRate = speed
|
||||||
|
this.updateTimestamp()
|
||||||
AbsAudioPlayer.setPlaybackSpeed({ value: speed })
|
AbsAudioPlayer.setPlaybackSpeed({ value: speed })
|
||||||
},
|
},
|
||||||
restart() {
|
restart() {
|
||||||
|
@ -502,19 +503,17 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateTimestamp() {
|
updateTimestamp() {
|
||||||
var ts = this.$refs.currentTimestamp
|
const ts = this.$refs.currentTimestamp
|
||||||
if (!ts) {
|
if (!ts) {
|
||||||
console.error('No timestamp el')
|
console.error('No timestamp el')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var currTimeStr = ''
|
let currentTime = this.currentTime / this.currentPlaybackRate
|
||||||
if (this.useChapterTrack && this.currentChapter) {
|
if (this.useChapterTrack && this.currentChapter) {
|
||||||
var currChapTime = Math.max(0, this.currentTime - this.currentChapter.start)
|
const currChapTime = Math.max(0, this.currentTime - this.currentChapter.start)
|
||||||
currTimeStr = this.$secondsToTimestamp(currChapTime)
|
currentTime = currChapTime / this.currentPlaybackRate
|
||||||
} else {
|
|
||||||
currTimeStr = this.$secondsToTimestamp(this.currentTime)
|
|
||||||
}
|
}
|
||||||
ts.innerText = currTimeStr
|
ts.innerText = this.$secondsToTimestamp(currentTime)
|
||||||
},
|
},
|
||||||
timeupdate() {
|
timeupdate() {
|
||||||
if (!this.$refs.playedTrack) {
|
if (!this.$refs.playedTrack) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue