feat(core): add thumbnail component and text track store feature#643
Merged
feat(core): add thumbnail component and text track store feature#643
Conversation
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
f8104f8 to
e3cd923
Compare
This was referenced Feb 27, 2026
Add ThumbnailCore with CSS constraint-based resize logic, text track store feature for reactive thumbnail/chapter cue data, and supporting utilities. Platform components (HTML/React) follow in separate PRs.
f745af9 to
2666ebb
Compare
Contributor
📦 Bundle Size Report
Total: 38.41 kB · +3.20 kB · +9.1% Entry BreakdownSubpath sizes are the additional bytes on top of the root entry point, measured by bundling root + subpath together and subtracting the root-only size.
|
| Entry | Base | PR | Diff | % | |
|---|---|---|---|---|---|
. |
3.21 kB | 3.86 kB | +659 B | +20.0% | 🔴 |
./dom |
3.65 kB | 4.36 kB | +720 B | +19.3% | 🔴 |
| total | 6.87 kB | 8.21 kB | +1.35 kB | +19.6% |
@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/icons
| Entry | Base | PR | Diff | % | |
|---|---|---|---|---|---|
./react |
2.27 kB | 2.27 kB | 0 B | 0% | ✅ |
./html |
1.52 kB | 1.52 kB | 0 B | 0% | ✅ |
| total | 3.79 kB | 3.79 kB | 0 B | 0% |
@videojs/store
| Entry | Base | PR | Diff | % | |
|---|---|---|---|---|---|
. |
1.29 kB | 1.29 kB | 0 B | 0% | ✅ |
./html |
468 B | 468 B | 0 B | 0% | ✅ |
./react |
199 B | 199 B | 0 B | 0% | ✅ |
| total | 1.94 kB | 1.94 kB | 0 B | 0% |
@videojs/utils
| Entry | Base | PR | Diff | % | |
|---|---|---|---|---|---|
./array |
104 B | 104 B | 0 B | 0% | ✅ |
./dom |
725 B | 760 B | +35 B | +4.8% | 🔺 |
./events |
227 B | 227 B | 0 B | 0% | ✅ |
./function |
197 B | 197 B | 0 B | 0% | ✅ |
./object |
119 B | 119 B | 0 B | 0% | ✅ |
./predicate |
265 B | 265 B | 0 B | 0% | ✅ |
./string |
110 B | 110 B | 0 B | 0% | ✅ |
./style |
185 B | 185 B | 0 B | 0% | ✅ |
./time |
478 B | 478 B | 0 B | 0% | ✅ |
./number |
158 B | 158 B | 0 B | 0% | ✅ |
| total | 2.51 kB | 2.54 kB | +35 B | +1.4% |
ℹ️ 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.
41d0881 to
c94a108
Compare
c94a108 to
f0eae6a
Compare
This was referenced Feb 27, 2026
Merged
Closed
This was referenced Mar 10, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref: #501
Ref: #496
Summary
Thumbnail preview core logic and text track store feature. Platform components (HTML, React) follow in stacked PRs.
ThumbnailCore— runtime-agnostic class: binary search for active thumbnail by time, CSS constraint-based scaling (uniform scale factor frommin/max-width/height), resize computation for sprite sheets viaoverflow: hidden+transform: translate().createThumbnailfactory (core/dom) — managesResizeObserver, imgload/errortracking, natural dimension caching, and CSS constraint reading. Lazy binding viaconnect()for frameworks with deferred element availability (React refs).textTrackFeature+selectTextTrack— store feature that monitorsTextTrackListfor thumbnail/chapter tracks, producing cue arrays and the thumbnail track's base URL.mapCuesToThumbnails— parses VTT cues with#xywh=media fragments intoThumbnailImage[].findTrackElement(utils/dom) — finds the<track>element backing aTextTrack.Sizing contract
Consumer controls size via CSS
max-width/max-heighton the container.ThumbnailCore.resize()reads constraints fromgetComputedStyle, computes a uniform scale factor, and returns container + image dimensions + sprite offsets. No constraints = native tile dimensions.Testing
54 core tests + 7 text track feature tests, all passing.