Skip to content

Commit fc2d76f

Browse files
Talha Jubair Siamtsensei
authored andcommitted
fix(captions): address code review round 3 findings
- Fix blank snapshot at frame 120 (4.0s is past linger window); use frame 85 (2.83s) which lands mid-word showing spoken+active states - Document KaraokeSweep's intentionally unused spring config in registry
1 parent 395ffa9 commit fc2d76f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/remotion/captions/visual-snapshot.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ const STYLES = [
2525
"box_highlight",
2626
] as const;
2727

28-
// Test frames: word 1 unspoken (frame 0), word 3 active (frame 60), word 5 spoken (frame 120)
29-
const TEST_FRAMES = [0, 60, 120] as const;
28+
// Test frames: all unspoken (frame 0), mid-chunk active (frame 60), final word active (frame 85 = 2.83s)
29+
// Frame 85 lands during "percent" (2.5-3.0s) so we see a mix of spoken + active states.
30+
// (Frame 120 = 4.0s is past linger window and renders blank.)
31+
const TEST_FRAMES = [0, 60, 85] as const;
3032

3133
const TEST_WORDS = [
3234
{ word: "The", start: 0.5, end: 0.8 },

src/remotion/compositions/OpenReelsVideo.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const CAPTION_STYLES: Record<string, { component: React.FC<CaptionStyleProps>; s
3434
bold_outline: { component: BoldOutline, springConfig: { damping: 15, stiffness: 250, mass: 0.5 } },
3535
clean: { component: Clean, springConfig: { damping: 12, stiffness: 200, mass: 0.5 } },
3636
gradient_rise: { component: GradientRise, springConfig: { damping: 8, stiffness: 150, mass: 0.5 } },
37+
// KaraokeSweep uses linear interpolation for its gradient wipe (not spring),
38+
// so this springConfig is unused by the style. Kept for registry type uniformity.
3739
karaoke_sweep: { component: KaraokeSweep, springConfig: { damping: 14, stiffness: 220, mass: 0.5 } },
3840
color_highlight: { component: ColorHighlight, springConfig: { damping: 12, stiffness: 200, mass: 0.5 } },
3941
block_impact: { component: BlockImpact, springConfig: { damping: 18, stiffness: 300, mass: 0.5 } },

0 commit comments

Comments
 (0)