mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 01:01:55 +01:00
Fix segments sometimes displaying after the seek bar if at the end
This commit is contained in:
parent
510db57666
commit
4bc180077e
1 changed files with 2 additions and 1 deletions
|
@ -197,8 +197,9 @@ class PreviewBar {
|
|||
if (!this.onMobileYouTube) bar.style.opacity = Config.config.barTypes[fullCategoryName]?.opacity;
|
||||
|
||||
bar.style.position = "absolute";
|
||||
const duration = segment[1] - segment[0];
|
||||
if (segment[1] - segment[0] > 0) bar.style.width = this.timeToPercentage(segment[1] - segment[0]);
|
||||
bar.style.left = this.timeToPercentage(segment[0]);
|
||||
bar.style.left = this.timeToPercentage(Math.min(this.videoDuration - Math.max(0, duration), segment[0]));
|
||||
|
||||
return bar;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue