Skip to content

fix(web): show hours in embed player duration - #2655

Merged
richiemcilroy merged 3 commits into
CapSoftware:mainfrom
patrickballard:fix/embed-player-duration-hours
Oct 19, 2026
Merged

richiemcilroy merged 3 commits into
CapSoftware:mainfrom
patrickballard:fix/embed-player-duration-hours

Conversation

@patrickballard

@patrickballard patrickballard commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The embed player formats the video duration with its own MM:SS helper, so any video an hour or longer renders as a bare minute count:

duration shown expected
1h 60:00 1:00:00
1h 3m 45s 63:45 1:03:45
2h 3m 4s 123:04 2:03:04
10h 600:00 10:00:00
missing NaN:NaN 00:00

This disagrees with the rest of the app for the same video: the share page formats time through media-chrome's timeUtils.formatTime, and dashboard search rolls over into hours too. Only the embed didn't.

Free-plan recordings are length-capped, but Pro and desktop recordings aren't, so hour-plus videos are routine.

Fix

Move the formatter to apps/web/lib/player-time.ts with hour rollover and a non-finite guard, and point the embed at it.

Output below an hour is byte-identical to before — verified by sweeping every integer from 1 to 3599 plus 20,000 random fractional values against the old implementation: zero mismatches. Only hour-plus durations and non-finite input change.

I kept this to the one call site rather than also folding in dashboard search's near-duplicate, since that one uses an unpadded style and changing it would be an unrequested behaviour change.

Verification

  • bun run test (apps/web) — 3447 passed, 0 failed
  • bun run typecheck — exit 0, no errors
  • bun run biome check — clean on all touched files
  • 4 new unit tests in __tests__/unit/player-time.test.ts, which fail against the previous implementation

I wasn't able to boot the app itself (no local Docker for MySQL/MinIO), so this is verified by the typecheck, the unit tests and both embed test suites rather than by clicking through a running embed.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

The embed now uses formatPlayerTime to show hour-long durations as H:MM:SS.

  • The embed player shows long recording lengths with hours.

Review checks were based on the code and test configuration. Tests and the running UI were not exercised during this review.

Reviews (1) · Last reviewed commit: "fix(web): show hours in embed player dur..." · Reviewed by Greptile

The embed player formatted the duration with its own MM:SS helper, so
anything an hour or longer rendered as a bare minute count: a 2h 3m 4s
video showed "123:04", and a missing duration showed "NaN:NaN". The
share page already rolls over into hours via media-chrome's time utils,
so the two surfaces disagreed on the same video.

Move the formatter to lib/player-time.ts with hour rollover and a
non-finite guard. Output below an hour is byte-identical to before.
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Oct 19, 2026 4:55pm UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status October 16, 2026 21:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status October 19, 2026 13:36 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cap-status October 19, 2026 16:55 Inactive
@richiemcilroy
richiemcilroy merged commit 128f1e0 into CapSoftware:main Oct 19, 2026
29 of 30 checks passed

This branch was previously deployed

1 inactive deployment
Preview – cap-status — 0698447b Deployed Oct 19, 2026 by vercel[bot]
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.

2 participants