Merge pull request #776 from alexmaras/fix/chapter-seek-bar

fix: use chapter duration when seeking on track bar
This commit is contained in:
advplyr 2022-06-25 10:40:55 -05:00 committed by GitHub
commit 4dbddcf179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,7 +83,9 @@ export default {
var offsetX = e.offsetX
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) {
console.error('Invalid time', perc, time)
return