@vivix-labs/media-tools 1.0.0-beta.17 → 1.0.0-beta.18

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.
package/README.md CHANGED
@@ -5,6 +5,11 @@ explicit file processing. It uses the existing Studio Host, project asset servic
5
5
  creative-data store. Native FFmpeg and ffprobe must already be installed; the package
6
6
  includes its short-lived supervision worker, UI, styles, fonts and icons.
7
7
 
8
+ Trim handle changes pause preview and seek to the changed boundary in either direction.
9
+ Moving the start earlier or the end later refreshes the displayed source frame even
10
+ when the old playhead remains within the expanded range. The end preview stays one
11
+ millisecond inside the exclusive out-point; source files remain unchanged until processing.
12
+
8
13
  ## Save, process and choose
9
14
 
10
15
  Apply saves an immutable editing recipe and returns `SavedEdit`. It does not encode a
@@ -474,8 +474,8 @@ function Icon({ name, size }) {
474
474
  },
475
475
  ...size === void 0 ? {} : { "--vx-icon-size": `${size}px` }
476
476
  };
477
- if (name === "relationships" || name === "color-adjust" || name === "speed") {
478
- return _jsx("svg", { "aria-hidden": "true", className: "vx-icon", "data-icon": name, style, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: name === "color-adjust" ? _jsxs(_Fragment, { children: [_jsx("path", { d: "M3 5h3m4 0h7M3 10h8m4 0h2M3 15h3m4 0h7" }), _jsx("circle", { cx: "8", cy: "5", r: "2" }), _jsx("circle", { cx: "13", cy: "10", r: "2" }), _jsx("circle", { cx: "8", cy: "15", r: "2" })] }) : name === "speed" ? _jsxs(_Fragment, { children: [_jsx("path", { d: "M4 16a8 8 0 1 1 12 0M10 3v2M3 10h2m10 0h2M5 5l1.4 1.4M10 12l4-5" }), _jsx("circle", { cx: "10", cy: "12", r: "1.5" })] }) : _jsxs(_Fragment, { children: [_jsx("path", { d: "M8.5 6.3 5 11.7M11.5 6.3 15 11.7M6.5 14.5h7" }), _jsx("circle", { cx: "10", cy: "4", r: "2.5" }), _jsx("circle", { cx: "4", cy: "14.5", r: "2.5" }), _jsx("circle", { cx: "16", cy: "14.5", r: "2.5" })] }) });
477
+ if (name === "menu" || name === "relationships" || name === "color-adjust" || name === "speed") {
478
+ return _jsx("svg", { "aria-hidden": "true", className: "vx-icon", "data-icon": name, style, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: name === "menu" ? _jsx("path", { d: "M3 5h14M3 10h14M3 15h14" }) : name === "color-adjust" ? _jsxs(_Fragment, { children: [_jsx("path", { d: "M3 5h3m4 0h7M3 10h8m4 0h2M3 15h3m4 0h7" }), _jsx("circle", { cx: "8", cy: "5", r: "2" }), _jsx("circle", { cx: "13", cy: "10", r: "2" }), _jsx("circle", { cx: "8", cy: "15", r: "2" })] }) : name === "speed" ? _jsxs(_Fragment, { children: [_jsx("path", { d: "M4 16a8 8 0 1 1 12 0M10 3v2M3 10h2m10 0h2M5 5l1.4 1.4M10 12l4-5" }), _jsx("circle", { cx: "10", cy: "12", r: "1.5" })] }) : _jsxs(_Fragment, { children: [_jsx("path", { d: "M8.5 6.3 5 11.7M11.5 6.3 15 11.7M6.5 14.5h7" }), _jsx("circle", { cx: "10", cy: "4", r: "2.5" }), _jsx("circle", { cx: "4", cy: "14.5", r: "2.5" }), _jsx("circle", { cx: "16", cy: "14.5", r: "2.5" })] }) });
479
479
  }
480
480
  return _jsx("span", { "aria-hidden": "true", className: "vx-icon", "data-icon": name, style });
481
481
  }
@@ -1363,6 +1363,7 @@ function RecipePlayer({
1363
1363
  const speed = recipe2.speed ?? 1;
1364
1364
  const color = recipe2.color;
1365
1365
  const bounds = React2.useRef(recipe2.trim);
1366
+ const previousTrim = React2.useRef(recipe2.trim);
1366
1367
  bounds.current = recipe2.trim;
1367
1368
  const crop = editingCrop ? { x: 0, y: 0, width: 1, height: 1 } : recipe2.crop;
1368
1369
  const aspect = video.displayWidth * crop.width / (video.displayHeight * crop.height);
@@ -1410,11 +1411,16 @@ function RecipePlayer({
1410
1411
  }, [video.previewUrl, playing]);
1411
1412
  React2.useEffect(() => {
1412
1413
  const element = media.current;
1414
+ const previous = previousTrim.current;
1415
+ previousTrim.current = recipe2.trim;
1413
1416
  if (element && Number.isFinite(element.duration)) {
1417
+ const changed = previous.inMs !== recipe2.trim.inMs || previous.outMs !== recipe2.trim.outMs;
1418
+ const previewTime = previous.inMs !== recipe2.trim.inMs ? recipe2.trim.inMs / 1e3 : previous.outMs !== recipe2.trim.outMs ? (recipe2.trim.outMs - 1) / 1e3 : element.currentTime;
1414
1419
  const clamped = Math.max(
1415
1420
  recipe2.trim.inMs / 1e3,
1416
- Math.min((recipe2.trim.outMs - 1) / 1e3, element.currentTime)
1421
+ Math.min((recipe2.trim.outMs - 1) / 1e3, previewTime)
1417
1422
  );
1423
+ if (changed) element.pause();
1418
1424
  if (element.currentTime !== clamped) element.currentTime = clamped;
1419
1425
  setTime(clamped);
1420
1426
  }
package/dist/shared.d.ts CHANGED
@@ -513,9 +513,9 @@ declare const exportSettings: z.ZodObject<{
513
513
  resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
514
514
  frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
515
515
  quality: z.ZodEnum<{
516
- small: "small";
517
516
  high: "high";
518
517
  standard: "standard";
518
+ small: "small";
519
519
  }>;
520
520
  audio: z.ZodBoolean;
521
521
  }, z.core.$strict>;
@@ -563,9 +563,9 @@ declare const processSequence: z.ZodObject<{
563
563
  resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
564
564
  frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
565
565
  quality: z.ZodEnum<{
566
- small: "small";
567
566
  high: "high";
568
567
  standard: "standard";
568
+ small: "small";
569
569
  }>;
570
570
  audio: z.ZodBoolean;
571
571
  }, z.core.$strict>>;
@@ -649,9 +649,9 @@ declare const mediaRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
649
649
  resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
650
650
  frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
651
651
  quality: z.ZodEnum<{
652
- small: "small";
653
652
  high: "high";
654
653
  standard: "standard";
654
+ small: "small";
655
655
  }>;
656
656
  audio: z.ZodBoolean;
657
657
  }, z.core.$strict>>;
@@ -753,9 +753,9 @@ declare const jobsQuery: z.ZodObject<{
753
753
  resolution: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<480>, z.ZodLiteral<720>, z.ZodLiteral<1080>, z.ZodLiteral<2160>]>;
754
754
  frameRate: z.ZodUnion<readonly [z.ZodLiteral<"source">, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<30>, z.ZodLiteral<50>, z.ZodLiteral<60>]>;
755
755
  quality: z.ZodEnum<{
756
- small: "small";
757
756
  high: "high";
758
757
  standard: "standard";
758
+ small: "small";
759
759
  }>;
760
760
  audio: z.ZodBoolean;
761
761
  }, z.core.$strict>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vivix-labs/media-tools",
3
- "version": "1.0.0-beta.17",
3
+ "version": "1.0.0-beta.18",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -37,9 +37,9 @@
37
37
  "react-dom": "^19.0.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@vivix-labs/ui-system": "workspace:*"
40
+ "@vivix-labs/ui-system": "1.0.0-beta.20"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "node ../../scripts/build-product-packages.mjs media-tools"
44
44
  }
45
- }
45
+ }