Skip to content

Commit

Permalink
fix(player): default to intrinsic aspect ratio for thumbnails
Browse files Browse the repository at this point in the history
closes #1399
  • Loading branch information
mihar-22 committed Sep 14, 2024
1 parent 5af7cb9 commit 921734f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vidstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"types": "pnpm declarations && pnpm run build:types",
"clean": "rimraf dist-npm",
"format": "prettier src --write --loglevel warn",
"sandbox": "node ../../.scripts/sandbox.js",
"sandbox": "node ../../.scripts/sandbox.js & pnpm run build:css -w",
"sandbox:build": "vite build sandbox",
"test": "vitest --run",
"test:watch": "vitest --watch",
Expand Down
4 changes: 3 additions & 1 deletion packages/vidstack/styles/player/default/thumbnail.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*/

:where(.vds-thumbnail) {
--aspect-ratio: calc(var(--media-thumbnail-aspect-ratio, 16 / 9));
--min-width: var(--media-thumbnail-min-width, 140px);
--max-width: var(--media-thumbnail-max-width, 180px);
--aspect-ratio: calc(
var(--media-thumbnail-aspect-ratio, calc(var(--thumbnail-width) / var(--thumbnail-height)))
);
display: block;
width: var(--thumbnail-width);
height: var(--thumbnail-height);
Expand Down

0 comments on commit 921734f

Please sign in to comment.