Skip to content

feat(core): add time display component#460

Merged
mihar-22 merged 2 commits intomainfrom
feat/time-component
Feb 6, 2026
Merged

feat(core): add time display component#460
mihar-22 merged 2 commits intomainfrom
feat/time-component

Conversation

@mihar-22
Copy link
Copy Markdown
Member

@mihar-22 mihar-22 commented Feb 5, 2026

Summary

  • Implements time display components for current, duration, and remaining time
  • Adds time formatting utilities aligned with Media Chrome
  • Full accessibility support with aria-label and aria-valuetext

Components

React

<Time.Value type="current" />
<Time.Group>
  <Time.Value type="current" />
  <Time.Separator />
  <Time.Value type="duration" />
</Time.Group>

HTML

<media-time type="current"></media-time>
<media-time-group>
  <media-time type="current"></media-time>
  <media-time-separator></media-time-separator>
  <media-time type="duration"></media-time>
</media-time-group>

New Utilities (@videojs/utils/time)

  • formatTime(seconds, guide) - Digital format (1:30, 1:05:30)
  • formatTimeAsPhrase(seconds) - Screen reader phrase (1 minute, 30 seconds)
  • secondsToIsoDuration(seconds) - ISO 8601 (PT1M30S)

Closes #266
Ref: #454 (design doc)

Implements time display components for showing current time, duration,
and remaining time in video players.

- Add formatTime, formatTimeAsPhrase, secondsToIsoDuration utilities
- Add TimeCore class with shared formatting logic
- Add React Time.Value, Time.Group, Time.Separator components
- Add HTML <media-time>, <media-time-group>, <media-time-separator> elements
- Support negative sign for remaining time with aria-hidden wrapper
- Align formatting with Media Chrome (guide minutes padding)

Closes #266
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 5, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
vjs-10-demo-react Ignored Ignored Preview Feb 6, 2026 3:29am

Request Review

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 5, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 04e14e1
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/6985602eee79480008a92367
😎 Deploy Preview https://deploy-preview-460--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mihar-22 mihar-22 changed the title feat(packages): add Time component feat(core): add time component Feb 5, 2026
@mihar-22 mihar-22 changed the title feat(core): add time component feat(core): add time display component Feb 6, 2026
@mihar-22 mihar-22 merged commit 7b8bc11 into main Feb 6, 2026
7 of 8 checks passed
@mihar-22 mihar-22 deleted the feat/time-component branch February 6, 2026 03:31
@github-actions github-actions bot mentioned this pull request Feb 6, 2026
@github-actions github-actions bot mentioned this pull request Feb 26, 2026
@github-actions github-actions bot mentioned this pull request Mar 10, 2026
@luwes luwes mentioned this pull request Apr 11, 2026
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.

UI: Time Component

1 participant