mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 13:07:05 +03:00
Fix start time in preview bar in wrong place
This commit is contained in:
@@ -199,7 +199,9 @@ class PreviewBar {
|
|||||||
bar.style.position = "absolute";
|
bar.style.position = "absolute";
|
||||||
const duration = segment[1] - segment[0];
|
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(Math.min(this.videoDuration - Math.max(0, duration), segment[0]));
|
|
||||||
|
const time = segment[1] ? Math.min(this.videoDuration - Math.max(0, duration), segment[0]) : segment[0];
|
||||||
|
bar.style.left = this.timeToPercentage(time);
|
||||||
|
|
||||||
return bar;
|
return bar;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user