Skip to content

feat: add slider preview thumbnails#935

Merged
sampotts merged 1 commit intomainfrom
feat/slider-previews
Mar 13, 2026
Merged

feat: add slider preview thumbnails#935
sampotts merged 1 commit intomainfrom
feat/slider-previews

Conversation

@sampotts
Copy link
Copy Markdown
Collaborator

Summary

  • add slider preview thumbnail UI to the default and minimal HTML and React video skins
  • wire sandbox templates to Mux storyboard and poster assets so previews render in demos
  • fix thumbnail state when React connects after an image has already loaded or errored

Testing

  • pnpm -F @videojs/core test src/dom/ui/tests/thumbnail.test.ts
  • pnpm exec biome check packages/core/src/dom/ui/thumbnail.ts packages/core/src/dom/ui/tests/thumbnail.test.ts packages/html/src/define/video/skin.ts packages/html/src/define/video/minimal-skin.ts packages/react/src/presets/video/skin.tsx packages/react/src/presets/video/minimal-skin.tsx packages/react/src/ui/thumbnail/index.ts packages/sandbox/app/shared/mux.ts packages/sandbox/app/shared/html/mux-storyboard.ts packages/sandbox/app/shared/react/mux-storyboard.tsx packages/sandbox/app/shared/react/mux-poster.tsx packages/skins/src/default/css/video.css packages/skins/src/minimal/css/video.css

Closes #814

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 13, 2026

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

Project Deployment Actions Updated (UTC)
v10-sandbox Ready Ready Preview, Comment Mar 13, 2026 11:57am

Request Review

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit d8bc0b9
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/69b3fb94899c4500077d859f
😎 Deploy Preview https://deploy-preview-935--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.

@sampotts sampotts requested review from Copilot and mihar-22 March 13, 2026 09:40
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 13, 2026

📦 Bundle Size Report

🎨 @videojs/html

Path Base PR Diff %
/video/minimal-skin.tailwind 21.38 kB 21.74 kB +367 B +1.7% 🔺
/video/skin.tailwind 21.63 kB 21.97 kB +345 B +1.6% 🔺
/video (default + hls) 152.28 kB 152.59 kB +316 B +0.2% 🔺
Presets (7)
Entry Size
/video (default) 22.19 kB
/video (default + hls) 152.59 kB
/video (minimal) 22.08 kB
/video (minimal + hls) 152.42 kB
/audio (default) 20.65 kB
/audio (minimal) 20.66 kB
/background 6.46 kB
Media (4)
Entry Size
/media/background-video 617 B
/media/container 1.91 kB
/media/hls-video 131.23 kB
/media/simple-hls-video 11.89 kB
Players (3)
Entry Size
/video/player 6.33 kB
/audio/player 6.32 kB
/background/player 6.31 kB
Skins (16)
Entry Type Size
/video/minimal-skin.css css 2.85 kB
/video/skin.css css 2.89 kB
/video/minimal-skin js 21.49 kB
/video/minimal-skin.tailwind js 21.74 kB
/video/skin js 21.63 kB
/video/skin.tailwind js 21.97 kB
/audio/minimal-skin.css css 2.17 kB
/audio/skin.css css 2.19 kB
/audio/minimal-skin js 20.13 kB
/audio/minimal-skin.tailwind js 20.05 kB
/audio/skin js 20.12 kB
/audio/skin.tailwind js 20.31 kB
/background/skin.css css 124 B
/background/skin js 999 B
/base.css css 205 B
/shared.css css 35 B
UI Components (21)
Entry Size
/ui/alert-dialog 2.05 kB
/ui/alert-dialog-close 1.26 kB
/ui/alert-dialog-description 1.54 kB
/ui/alert-dialog-title 1.53 kB
/ui/buffering-indicator 1.77 kB
/ui/captions-button 1.75 kB
/ui/controls 1.78 kB
/ui/fullscreen-button 1.79 kB
/ui/mute-button 1.78 kB
/ui/pip-button 1.78 kB
/ui/play-button 1.79 kB
/ui/playback-rate-button 1.81 kB
/ui/popover 3.16 kB
/ui/poster 1.68 kB
/ui/seek-button 1.80 kB
/ui/slider 1.99 kB
/ui/thumbnail 2.10 kB
/ui/time 1.62 kB
/ui/time-slider 2.96 kB
/ui/tooltip 2.42 kB
/ui/volume-slider 2.17 kB

Sizes are marginal over the root entry point.

⚛️ @videojs/react

Path Base PR Diff %
/video/minimal-skin 16.78 kB 18.34 kB +1.56 kB +9.3% 🔺
/video/minimal-skin.tailwind 19.42 kB 21.14 kB +1.72 kB +8.8% 🔺
/video/skin 16.80 kB 18.30 kB +1.50 kB +9.0% 🔺
/video/skin.tailwind 19.51 kB 21.19 kB +1.69 kB +8.6% 🔺
/ui/thumbnail 2.60 kB 🆕
/video (default) 16.93 kB 18.42 kB +1.49 kB +8.8% 🔺
/video (default + hls) 147.62 kB 149.12 kB +1.50 kB +1.0% 🔺
/video (minimal) 16.89 kB 18.40 kB +1.50 kB +8.9% 🔺
/video (minimal + hls) 147.78 kB 149.14 kB +1.35 kB +0.9% 🔺
Presets (7)
Entry Size
/video (default) 18.42 kB
/video (default + hls) 149.12 kB
/video (minimal) 18.40 kB
/video (minimal + hls) 149.14 kB
/audio (default) 14.59 kB
/audio (minimal) 14.64 kB
/background 3.19 kB
Media (3)
Entry Size
/media/background-video 539 B
/media/hls-video 131.52 kB
/media/simple-hls-video 12.28 kB
Skins (14)
Entry Type Size
/video/minimal-skin.css css 2.84 kB
/video/skin.css css 2.88 kB
/video/minimal-skin js 18.34 kB
/video/minimal-skin.tailwind js 21.14 kB
/video/skin js 18.30 kB
/video/skin.tailwind js 21.19 kB
/audio/minimal-skin.css css 2.16 kB
/audio/skin.css css 2.18 kB
/audio/minimal-skin js 14.54 kB
/audio/minimal-skin.tailwind js 16.40 kB
/audio/skin js 14.48 kB
/audio/skin.tailwind js 16.63 kB
/background/skin.css css 90 B
/background/skin js 272 B
UI Components (18)
Entry Size
/ui/alert-dialog 2.72 kB
/ui/buffering-indicator 2.22 kB
/ui/captions-button 2.26 kB
/ui/controls 2.19 kB
/ui/fullscreen-button 2.27 kB
/ui/mute-button 2.29 kB
/ui/pip-button 2.25 kB
/ui/play-button 2.26 kB
/ui/playback-rate-button 2.26 kB
/ui/popover 3.12 kB
/ui/poster 2.04 kB
/ui/seek-button 2.25 kB
/ui/slider 3.11 kB
/ui/thumbnail 2.60 kB
/ui/time 2.33 kB
/ui/time-slider 2.80 kB
/ui/tooltip 3.26 kB
/ui/volume-slider 2.74 kB

Sizes are marginal over the root entry point.

🧩 @videojs/core

(no changes)

Entries (5)
Entry Size
. 4.78 kB
/dom 8.09 kB
/dom/media/custom-media-element 1.76 kB
/dom/media/hls 131.14 kB
/dom/media/simple-hls 11.85 kB

🏷️ @videojs/element

(no changes)

Entries (2)
Entry Size
. 999 B
/context 936 B

📦 @videojs/store

(no changes)

Entries (3)
Entry Size
. 1.32 kB
/html 700 B
/react 360 B

🔧 @videojs/utils

(no changes)

Entries (10)
Entry Size
/array 104 B
/dom 1003 B
/events 227 B
/function 261 B
/object 119 B
/predicate 265 B
/string 148 B
/style 190 B
/time 478 B
/number 158 B

📦 @videojs/spf

(no changes)

Entries (3)
Entry Size
. 40 B
/dom 10.04 kB
/playback-engine 9.95 kB

ℹ️ How to interpret

All sizes are standalone totals (minified + brotli).

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

Run pnpm size locally to check current sizes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds slider preview thumbnails to default and minimal video skins (CSS + Tailwind, HTML + React), wires Mux storyboard/poster assets into sandbox demos, and fixes thumbnail state detection when React connects after an image has already loaded or errored.

Changes:

  • New preview component styles (CSS and Tailwind) for both default and minimal skins, plus popup/surface animation tweaks
  • Preview thumbnail markup added to all HTML and React skin templates with spinner and timestamp
  • Thumbnail connect() logic updated to handle errored images, with corresponding tests

Reviewed changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/core/src/dom/ui/thumbnail.ts Handle errored images on connect
packages/core/src/dom/ui/tests/thumbnail.test.ts Tests for React lifecycle edge cases
packages/html/src/define/video/skin.ts Add preview markup to default HTML skin
packages/html/src/define/video/skin.tailwind.ts Add preview markup to default Tailwind HTML skin
packages/html/src/define/video/minimal-skin.ts Add preview markup to minimal HTML skin
packages/html/src/define/video/minimal-skin.tailwind.ts Add preview markup to minimal Tailwind HTML skin
packages/react/src/presets/video/skin.tsx Add preview to default React skin
packages/react/src/presets/video/skin.tailwind.tsx Add preview to default Tailwind React skin
packages/react/src/presets/video/minimal-skin.tsx Add preview to minimal React skin
packages/react/src/presets/video/minimal-skin.tailwind.tsx Add preview to minimal Tailwind React skin
packages/react/src/ui/thumbnail/index.ts Re-export thumbnail component
packages/skins/src/default/css/* Default skin CSS: preview, surface, popup, reset changes
packages/skins/src/default/tailwind/* Default skin Tailwind: preview, surface, popup changes
packages/skins/src/minimal/css/* Minimal skin CSS: preview, popup, reset changes
packages/skins/src/minimal/tailwind/* Minimal skin Tailwind: preview, popup changes
packages/sandbox/** Wire Mux storyboard/poster into all sandbox templates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread packages/skins/src/default/css/video.css Outdated
Comment thread packages/html/src/define/video/skin.ts Outdated
Comment thread packages/html/src/define/video/minimal-skin.ts Outdated
Comment thread packages/skins/src/minimal/css/video.css Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds slider preview thumbnails to the video player skins, wires sandbox demos to Mux storyboard/poster assets, and fixes thumbnail state detection when React connects after an image has already loaded or errored.

Changes:

  • New preview component CSS/Tailwind styles for both default and minimal skins, with thumbnail, timestamp, and loading spinner
  • Preview markup added to all HTML and React skin templates (CSS and Tailwind variants)
  • Fix in createThumbnail to handle errored images on connect (complete but zero dimensions), with corresponding tests

Reviewed changes

Copilot reviewed 51 out of 51 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/core/src/dom/ui/thumbnail.ts Fix connect() to detect errored images
packages/core/src/dom/ui/tests/thumbnail.test.ts Tests for React lifecycle connect scenarios
packages/core/src/dom/ui/slider.ts Add preventScroll/focusVisible to thumb focus
packages/skins/src/default/css/components/preview.css New preview component CSS (default)
packages/skins/src/minimal/css/components/preview.css New preview component CSS (minimal)
packages/skins/src/default/tailwind/components/preview.ts New preview Tailwind classes (default)
packages/skins/src/minimal/tailwind/components/preview.ts New preview Tailwind classes (minimal)
packages/skins/src/*/css/video.css Slider preview positioning styles
packages/skins/src/*/tailwind/video.tailwind.ts Slider preview positioning Tailwind
packages/html/src/define/video/*.ts Add preview markup to HTML skin templates
packages/react/src/presets/video/*.tsx Add preview markup to React skin components
packages/sandbox/app/shared/mux.ts Mux asset ID extraction utility
packages/sandbox/app/shared//mux-.ts(x) Storyboard/poster helpers for sandbox
packages/sandbox/templates/*/main.ts(x) Wire storyboard/poster into sandbox demos
Various reset/button/popup/surface/slider files Minor style tweaks (margin reset removal, touch-manipulation, animation tuning, surface ring fix)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +6 to +10

export function getMuxPosterSrc(source: SourceId): string | undefined {
const id = getMuxAssetId(source);
return id ? `https://image.mux.com/${id}/thumbnail.jpg` : undefined;
}
@sampotts sampotts merged commit e3f438e into main Mar 13, 2026
24 checks passed
@sampotts sampotts deleted the feat/slider-previews branch March 13, 2026 21:30
@github-actions github-actions bot mentioned this pull request Mar 13, 2026
This was referenced 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.

Skins: Add slider time preview and thumbs

2 participants