mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 04:57:09 +03:00
Fix segments sometimes displaying after the seek bar if at the end
This commit is contained in:
@@ -197,8 +197,9 @@ class PreviewBar {
|
|||||||
if (!this.onMobileYouTube) bar.style.opacity = Config.config.barTypes[fullCategoryName]?.opacity;
|
if (!this.onMobileYouTube) bar.style.opacity = Config.config.barTypes[fullCategoryName]?.opacity;
|
||||||
|
|
||||||
bar.style.position = "absolute";
|
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]);
|
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;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user