sanity-plugin-r2-video 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1386,6 +1386,7 @@ var DialogDetails = ({
1386
1386
  fetchFolders(client, config.folders.type).then(setFolders);
1387
1387
  }, [client, config.folders.type]);
1388
1388
  const paths = resolveFolderPaths(folders);
1389
+ const isBroken = asset.renditions.length === 0;
1389
1390
  const trimmed = filename.trim();
1390
1391
  const savedFolderId = asset.folder ? asset.folder._ref : "";
1391
1392
  const isRenamed = trimmed.length > 0 && trimmed !== asset.filename;
@@ -1458,7 +1459,7 @@ var DialogDetails = ({
1458
1459
  onClick: isDirty ? reset : onClose
1459
1460
  }
1460
1461
  ) }),
1461
- /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(
1462
+ !isBroken && /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(
1462
1463
  Button,
1463
1464
  {
1464
1465
  disabled: isSaving || !isDirty,
@@ -1469,7 +1470,7 @@ var DialogDetails = ({
1469
1470
  }
1470
1471
  ) })
1471
1472
  ] }) }),
1472
- children: /* @__PURE__ */ jsx(Card, { padding: 4, children: /* @__PURE__ */ jsxs(Stack, { gap: 5, children: [
1473
+ children: /* @__PURE__ */ jsx(Card, { padding: 4, children: isBroken ? /* @__PURE__ */ jsx(Card, { padding: 4, radius: 2, tone: "caution", children: /* @__PURE__ */ jsx(Text, { size: 1, children: "This video was never finished uploading, so it has no renditions and nothing stored behind it. Delete it." }) }) : /* @__PURE__ */ jsxs(Stack, { gap: 5, children: [
1473
1474
  /* @__PURE__ */ jsx(
1474
1475
  VideoPreview,
1475
1476
  {
@@ -45,7 +45,11 @@ var encodeRendition = async (source, width, height, hasAudio, isNative, options,
45
45
  video: isNative ? {} : {
46
46
  width,
47
47
  height,
48
- fit: "contain",
48
+ // Cover, not contain: the even-width rounding above means the
49
+ // box rarely matches the source aspect exactly, and contain
50
+ // fills that sub-pixel gap with black bars that survive into
51
+ // the file. Cover crops the under-a-pixel overflow instead
52
+ fit: "cover",
49
53
  codec: options.videoCodec,
50
54
  quality
51
55
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity-plugin-r2-video",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Video for Sanity Studio, encoded in the browser and stored in Cloudflare R2 as a ladder of plain MP4s.",
5
5
  "keywords": [
6
6
  "sanity",