Skip to content

Commit 49b9894

Browse files
committed
Ensure progress bar doesn't encroach out of container
1 parent 1e24fdf commit 49b9894

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dotcom-rendering/src/components/LoopVideoProgressBar.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ export const LoopVideoProgressBar = ({
5353
*/
5454
const adjustedDuration = Math.max(duration - 0.25, 0.1);
5555

56-
const progressPercentage = (currentTime * 100) / adjustedDuration;
56+
const progressPercentage = Math.min(
57+
(currentTime * 100) / adjustedDuration,
58+
100,
59+
);
5760
if (Number.isNaN(progressPercentage)) {
5861
return null;
5962
}

0 commit comments

Comments
 (0)