mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-05-18 01:15:31 +02:00
Merge pull request #776 from alexmaras/fix/chapter-seek-bar
fix: use chapter duration when seeking on track bar
This commit is contained in:
commit
4dbddcf179
@ -83,7 +83,9 @@ export default {
|
|||||||
|
|
||||||
var offsetX = e.offsetX
|
var offsetX = e.offsetX
|
||||||
var perc = offsetX / this.trackWidth
|
var perc = offsetX / this.trackWidth
|
||||||
var time = perc * this.duration
|
const baseTime = this.useChapterTrack ? this.currentChapterStart : 0;
|
||||||
|
const duration = this.useChapterTrack ? this.currentChapterDuration : this.duration;
|
||||||
|
var time = baseTime + (perc * duration);
|
||||||
if (isNaN(time) || time === null) {
|
if (isNaN(time) || time === null) {
|
||||||
console.error('Invalid time', perc, time)
|
console.error('Invalid time', perc, time)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user