Skip to content

🎥 Make videos programmatically with React

`@remotion/player`: Fix seek track potentially being wider than the knob

Jonny Burger8f0658570221
diff --git a/packages/player/src/PlayerSeekBar.tsx b/packages/player/src/PlayerSeekBar.tsx
index ed448358af..498e004a84 100644
--- a/packages/player/src/PlayerSeekBar.tsx
+++ b/packages/player/src/PlayerSeekBar.tsx
@@ -184,11 +184,11 @@ export const PlayerSeekBar: React.FC<{
return {
height: BAR_HEIGHT,
backgroundColor: 'rgba(255, 255, 255, 1)',
- width: ((frame - (inFrame ?? 0)) / (durationInFrames - 1)) * 100 + '%',
- marginLeft: ((inFrame ?? 0) / (durationInFrames - 1)) * 100 + '%',
+ width: ((frame - (inFrame ?? 0)) / (durationInFrames - 1)) * width,
+ marginLeft: ((inFrame ?? 0) / (durationInFrames - 1)) * width,
borderRadius: BAR_HEIGHT / 2,
};
- }, [durationInFrames, frame, inFrame]);
+ }, [durationInFrames, frame, inFrame, width]);
const active: React.CSSProperties = useMemo(() => {
return {