Skip to content

feat(core): add seek button component#526

Merged
mihar-22 merged 2 commits intomainfrom
seek-button
Feb 13, 2026
Merged

feat(core): add seek button component#526
mihar-22 merged 2 commits intomainfrom
seek-button

Conversation

@mihar-22
Copy link
Member

Closes #495

Summary

Add SeekButton component for seeking forward/backward by a configurable number of seconds. Follows the same three-layer pattern as PlayButton (Core + HTML + React) with a single seconds prop that supports positive (forward) and negative (backward) values.

Changes

  • SeekButtonCore class with seconds prop (default 30), label generation using Math.abs to avoid negative signs in accessibility labels
  • SeekButtonDataAttrs mapping seeking and seconds to data attributes for CSS-driven styling
  • <media-seek-button> custom element with seconds, label, and disabled attributes, using selectTime selector
  • <SeekButton> React component with render prop support, matching existing button patterns
  • 19 unit tests covering props, state projection, labels, attrs, and seek action
Implementation details

Design decision: Single component vs two. Unlike Media Chrome (separate forward/backward elements), this uses Vidstack's approach — one component where the sign of seconds communicates direction. Avoids ~95% code duplication while data-seconds enables CSS targeting via [data-seconds^="-"].

No clamping in the button. The store's timeFeature.seek() already clamps to [0, duration], so the button just computes currentTime + seconds and delegates.

Default 30s matches both Vidstack and Media Chrome industry defaults.

Testing

pnpm -F @videojs/core test src/core/ui/seek-button

All workspace tests pass: pnpm test (12 tasks, 244+ tests).

@netlify
Copy link

netlify bot commented Feb 13, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 2f4779e
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/698f18f15c357b0008abe8c4
😎 Deploy Preview https://deploy-preview-526--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.

@vercel
Copy link

vercel bot commented Feb 13, 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 13, 2026 0:28am

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

📦 Bundle Size Report

Package Size Diff %
@videojs/core 4.20 kB +122 B ████████ +2.9% 🔺
@videojs/element 1.60 kB 0 B ░░░░░░░░ 0%
@videojs/html 7.67 kB +163 B ██████░░ +2.1% 🔺
@videojs/react 6.81 kB +197 B ████████ +2.9% 🔺
@videojs/store 1.86 kB 0 B ░░░░░░░░ 0%
@videojs/utils 1.87 kB 0 B ░░░░░░░░ 0%

Total: 24.01 kB · +482 B · +2.0%


Entry Breakdown

Subpath sizes are the additional bytes on top of the root entry point, measured by bundling root + subpath together and subtracting the root-only size.

@videojs/core
Entry Base PR Diff %
. 1.39 kB 1.52 kB +131 B +9.2% 🔺
./dom 2.68 kB 2.67 kB -9 B -0.3% 🔽
total 4.08 kB 4.20 kB +122 B +2.9%
@videojs/element
Entry Base PR Diff %
. 817 B 817 B 0 B 0%
./context 823 B 823 B 0 B 0%
total 1.60 kB 1.60 kB 0 B 0%
@videojs/store
Entry Base PR Diff %
. 1.29 kB 1.29 kB 0 B 0%
./html 394 B 394 B 0 B 0%
./react 190 B 190 B 0 B 0%
total 1.86 kB 1.86 kB 0 B 0%
@videojs/utils
Entry Base PR Diff %
./array 104 B 104 B 0 B 0%
./dom 553 B 553 B 0 B 0%
./events 227 B 227 B 0 B 0%
./function 181 B 181 B 0 B 0%
./object 119 B 119 B 0 B 0%
./predicate 265 B 265 B 0 B 0%
./time 465 B 465 B 0 B 0%
total 1.87 kB 1.87 kB 0 B 0%

ℹ️ How to interpret

Sizes are minified + brotli, measured with esbuild.
Package totals are computed as root size + marginal subpath costs.
Subpath marginal cost = (root + subpath bundled together) − root alone.

Icon Meaning
No change
🔺 Increased ≤ 10%
🔴 Increased > 10%
🔽 Decreased
🆕 New (no baseline)

Run pnpm size locally to check current sizes.

@mihar-22 mihar-22 changed the title feat(packages): add seek button component feat(core): add seek button component Feb 13, 2026
@mihar-22 mihar-22 merged commit c733077 into main Feb 13, 2026
11 checks passed
@mihar-22 mihar-22 deleted the seek-button branch February 13, 2026 12:30
@github-actions github-actions bot mentioned this pull request Feb 13, 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: Seek Button Component

1 participant