Skip to content

fix: distribute infographic URLs as arrays for multi-image cycling#647

Merged
codercatdev merged 1 commit intomainfrom
fix/infographic-urls-array
Mar 13, 2026
Merged

fix: distribute infographic URLs as arrays for multi-image cycling#647
codercatdev merged 1 commit intomainfrom
fix/infographic-urls-array

Conversation

@codercatdev
Copy link
Copy Markdown
Contributor

Fix: Distribute infographic URLs as arrays for multi-image cycling

One file: lib/services/video-pipeline.ts

Problem

video-pipeline.ts assigns a single infographicUrl per scene (round-robin):

infographicUrl: infographicUrls[i % infographicUrls.length]

But InfographicScene (PR #639) expects infographicUrls (plural, array) to cycle through multiple images with crossfade at 4-second intervals.

Fix

Distribute URLs evenly across scenes as arrays:

// 19 infographics across 4 scenes:
Scene 1: images 0-3  (4 images, ~16s of cycling)
Scene 2: images 4-7  (4 images)
Scene 3: images 8-11 (4 images)
Scene 4: images 12-18 (7 images, gets remainder)

Each scene gets infographicUrls: string[] (array for cycling) AND infographicUrl: string (first image, backward compat).

Impact

  • InfographicScene will now cycle through 4-5 images per scene instead of showing one static image
  • At 4 seconds per image, a 15-second scene shows ~4 different infographics with crossfade
  • Backward compatible: single infographicUrl still set for any code reading it

video-pipeline.ts was assigning a single infographicUrl per scene
(round-robin). InfographicScene expects infographicUrls (plural array)
to cycle through multiple images with crossfade at 4-second intervals.

Now distributes URLs evenly across scenes:
- 19 images / 4 scenes = ~4-5 images per scene
- Last scene gets remaining images
- Keeps single infographicUrl for backward compat (first in set)

Example: 19 infographics across 4 scenes:
  Scene 1: images 0-3 (4 images, ~16s of cycling)
  Scene 2: images 4-7 (4 images)
  Scene 3: images 8-11 (4 images)
  Scene 4: images 12-18 (7 images, gets remainder)
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
codingcat-dev Ignored Ignored Mar 13, 2026 7:09am

@codercatdev codercatdev merged commit bf9fde0 into main Mar 13, 2026
2 checks passed
@codercatdev codercatdev deleted the fix/infographic-urls-array branch March 13, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant