pixi-effects 0.47.5 → 0.48.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.48.0
4
+
5
+ A page that only plays no longer loads mediabunny (about 180 KB gzipped, a third of what such a page loaded). Nothing breaks.
6
+
7
+ - **mediabunny is fetched the first time something needs it:** the first `movie.render()` (or the download button), or a movie with a `video` asset at `init`. Before, every page imported it at load, and a page whose import map had no `"mediabunny"` entry failed to load at all. Now the entry is needed only to export or for a video layer; a bundler puts it in a chunk of its own.
8
+ - **New: `useMediabunny(source)`** says where it comes from: the module itself, a URL to `import()`, or a function that returns the module. With nothing said, the bare name `'mediabunny'` is imported as before. When it cannot be loaded, the export rejects with a sentence that says what to add, and the next call tries again.
9
+ - A test film (`export-mediabunny-on-demand`) holds it: no fetch while playing, the export and the video layer fetch it, the error and the retry.
10
+
3
11
  ## 0.47.5
4
12
 
5
13
  An island inside a hole no longer draws a wedge, and `init({ loudness })` is never quieter than the plain gain. Nothing breaks.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pixi-effects
2
2
 
3
- > **Status**: experimental — current release `0.47.5`. The API may still change between minor versions; see the [CHANGELOG](./CHANGELOG.md) for what each release changed.
3
+ > **Status**: experimental — current release `0.48.0`. The API may still change between minor versions; see the [CHANGELOG](./CHANGELOG.md) for what each release changed.
4
4
 
5
5
  **[Gallery →](https://yjmtmtk.github.io/pixi-effects/examples/gallery/)** · 43 pieces written as plain data by AI models · **[For AI →](https://yjmtmtk.github.io/pixi-effects/for-ai.html)** · what an AI reads and runs · **[Playground →](https://yjmtmtk.github.io/pixi-effects/examples/playground.html)** in the browser.
6
6
 
@@ -29,7 +29,7 @@ Declarative composition and video rendering for the web. After Effects-style tim
29
29
  - **Built-in player UI — or your own** — a drop-in HTML5-`<video>`-style overlay controller (play, scrub, mute, volume, fullscreen, export-to-file) whose colours are one option (`theme: { accent: '#ff4d6d' }`); or build a player yourself on the movie's `<video>`-named events (`play pause ended seeking seeked volumechange error`).
30
30
  - **MP4 / WebM / MOV export** — pick container and quality from the controller, call `movie.render()` from code, or render headless from the command line (`pixi-effects render`).
31
31
  - **A timeline you can read and scrub** — `movie.timelineChart()` draws every layer as a bar on a time axis; `pixi-effects view` opens the page with that timeline under it, zoomable, with a playhead you can drag.
32
- - **Tiny dependency surface** — only `mediabunny` (runtime) plus PixiJS (a peer dep). three.js is an *optional* peer, needed only if you import `pixi-effects/three`.
32
+ - **Tiny dependency surface** — only `mediabunny` (runtime) plus PixiJS (a peer dep). three.js is an *optional* peer, needed only if you import `pixi-effects/three`. mediabunny is fetched only when you export or use a video layer: a page that only plays never loads it.
33
33
 
34
34
  ## Install
35
35
 
@@ -49,8 +49,8 @@ Drop the imports into an [importmap](https://developer.mozilla.org/docs/Web/HTML
49
49
  "imports": {
50
50
  "pixi.js": "https://esm.sh/pixi.js@8.22.0?bundle-deps",
51
51
  "mediabunny": "https://esm.sh/mediabunny",
52
- "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.47.5/dist/index.js",
53
- "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.47.5/dist/Controller.js"
52
+ "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.48.0/dist/index.js",
53
+ "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.48.0/dist/Controller.js"
54
54
  }
55
55
  }
56
56
  </script>
@@ -61,7 +61,9 @@ Drop the imports into an [importmap](https://developer.mozilla.org/docs/Web/HTML
61
61
  </script>
62
62
  ```
63
63
 
64
- Load the `dist/` files **as they are** (jsDelivr's `/npm/…/dist/…`, or unpkg's `https://unpkg.com/pixi-effects@0.47.5/dist/index.js`) rather than a CDN-rebundled build such as `esm.sh/pixi-effects` or jsDelivr's `+esm`: the entries (`pixi-effects`, `…/controller`, `…/three`) share internal chunks, which only works when each file is served untouched.
64
+ The `mediabunny` line is needed only to export (the download button, `movie.render()`) or for a `video` layer; a page that only plays can leave it out and never fetches it (or call `useMediabunny(url)` instead, see [the API](docs/api.md#where-the-encoder-comes-from-usemediabunnysource)).
65
+
66
+ Load the `dist/` files **as they are** (jsDelivr's `/npm/…/dist/…`, or unpkg's `https://unpkg.com/pixi-effects@0.48.0/dist/index.js`) rather than a CDN-rebundled build such as `esm.sh/pixi-effects` or jsDelivr's `+esm`: the entries (`pixi-effects`, `…/controller`, `…/three`) share internal chunks, which only works when each file is served untouched.
65
67
 
66
68
  > **Using three.js?** Add two more entries (`three` and `pixi-effects/three`) to this importmap — see [Adding three.js](#adding-threejs-optional) below.
67
69
  >
@@ -78,7 +80,7 @@ Add two more entries to the importmap above: three.js itself, and the `pixi-effe
78
80
  "...": "(everything from the importmap above)",
79
81
  "three": "https://esm.sh/three@0.178.0",
80
82
  "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.178.0/examples/jsm/",
81
- "pixi-effects/three": "https://cdn.jsdelivr.net/npm/pixi-effects@0.47.5/dist/three.js"
83
+ "pixi-effects/three": "https://cdn.jsdelivr.net/npm/pixi-effects@0.48.0/dist/three.js"
82
84
  }
83
85
  }
84
86
  </script>
@@ -59,9 +59,9 @@
59
59
  "imports": {
60
60
  "pixi.js": "https://cdn.jsdelivr.net/npm/pixi.js@8.22.0/dist/pixi.min.mjs",
61
61
  "mediabunny": "https://cdn.jsdelivr.net/npm/mediabunny@1.61.3/+esm",
62
- "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.47.5/dist/index.js",
63
- "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.47.5/dist/Controller.js",
64
- "pixi-effects/present": "https://cdn.jsdelivr.net/npm/pixi-effects@0.47.5/dist/present.js"
62
+ "pixi-effects": "https://cdn.jsdelivr.net/npm/pixi-effects@0.48.0/dist/index.js",
63
+ "pixi-effects/controller": "https://cdn.jsdelivr.net/npm/pixi-effects@0.48.0/dist/Controller.js",
64
+ "pixi-effects/present": "https://cdn.jsdelivr.net/npm/pixi-effects@0.48.0/dist/present.js"
65
65
  }
66
66
  }
67
67
  </script>
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var chunkVQXZ2NOI_cjs = require('./chunk-VQXZ2NOI.cjs');
3
4
  var chunkDOLTCXCL_cjs = require('./chunk-DOLTCXCL.cjs');
4
5
 
5
6
  // src/controller/css.ts
@@ -1098,6 +1099,8 @@ var Controller = class _Controller {
1098
1099
  this.hideTimer = null;
1099
1100
  }
1100
1101
  this.setVisible(true);
1102
+ chunkVQXZ2NOI_cjs.loadMediabunny().catch(() => {
1103
+ });
1101
1104
  } else {
1102
1105
  this.kickIdleTimer();
1103
1106
  }