image-to-pixel 3.1.0 → 3.2.0
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 +4 -1
- package/dist/editor.css +1 -1
- package/dist/editor.css.map +2 -2
- package/dist/editor.esm.js +54 -54
- package/dist/editor.esm.js.map +4 -4
- package/dist/image-to-pixel.bundle.esm.js +13 -13
- package/dist/image-to-pixel.bundle.esm.js.map +3 -3
- package/dist/image-to-pixel.cjs +13 -9
- package/dist/image-to-pixel.cjs.map +2 -2
- package/dist/image-to-pixel.esm.js +13 -9
- package/dist/image-to-pixel.esm.js.map +2 -2
- package/dist/image-to-pixel.js +13 -9
- package/dist/image-to-pixel.js.map +2 -2
- package/dist/image-to-pixel.min.js +11 -11
- package/dist/image-to-pixel.min.js.map +3 -3
- package/dist/video.esm.js +2 -2
- package/dist/video.esm.js.map +3 -3
- package/lib/core/video/frames.js +189 -182
- package/lib/editor/exporter.js +267 -225
- package/lib/editor/index.js +1051 -1002
- package/lib/editor/inspector.js +379 -343
- package/lib/editor/storyboard.js +566 -0
- package/lib/editor/styles/editor.css +455 -418
- package/lib/editor/timeline-preview.js +142 -0
- package/package.json +1 -1
- package/types/index.d.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! image-to-pixel v3.
|
|
1
|
+
/*! image-to-pixel v3.2.0 | MIT | https://github.com/Tezumie/Image-to-Pixel */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __esm = (fn, res) => function __init() {
|
|
@@ -2401,19 +2401,23 @@ async function forEachFrame(video, opts) {
|
|
|
2401
2401
|
await videoReady(video);
|
|
2402
2402
|
const wasPaused = video.paused;
|
|
2403
2403
|
video.pause();
|
|
2404
|
-
const times = frameTimes({ duration: video.duration, ...opts });
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2404
|
+
const times = Array.isArray(opts.times) ? opts.times.filter((t) => Number.isFinite(t)).slice(0, opts.maxFrames ?? Infinity) : frameTimes({ duration: video.duration, ...opts });
|
|
2405
|
+
try {
|
|
2406
|
+
for (let i = 0; i < times.length; i++) {
|
|
2407
|
+
if (opts.signal?.aborted) throw new DOMException("Aborted", "AbortError");
|
|
2408
|
+
await seekTo(video, times[i]);
|
|
2409
|
+
if (opts.signal?.aborted) throw new DOMException("Aborted", "AbortError");
|
|
2410
|
+
await opts.onFrame({ index: i, time: times[i], total: times.length });
|
|
2411
|
+
}
|
|
2412
|
+
} finally {
|
|
2413
|
+
if (!wasPaused) video.play().catch(() => {
|
|
2414
|
+
});
|
|
2409
2415
|
}
|
|
2410
|
-
if (!wasPaused) video.play().catch(() => {
|
|
2411
|
-
});
|
|
2412
2416
|
return times.length;
|
|
2413
2417
|
}
|
|
2414
2418
|
|
|
2415
2419
|
// lib/index.js
|
|
2416
|
-
var VERSION = true ? "3.
|
|
2420
|
+
var VERSION = true ? "3.2.0" : "dev";
|
|
2417
2421
|
export {
|
|
2418
2422
|
ASPECTS,
|
|
2419
2423
|
DEFAULTS,
|