fix: use chapter start as a base for the seek time if seeking within chapters

This commit is contained in:
Alex Maras 2022-06-25 23:37:18 +08:00
parent 067006f406
commit f2fff34d4d

View File

@ -83,8 +83,9 @@ export default {
var offsetX = e.offsetX
var perc = offsetX / this.trackWidth
const duration = this.useChapterTrack ? this.currentChapterDuration : this.duration
var time = perc * 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) {
console.error('Invalid time', perc, time)
return