@arraypress/waveform-player 1.26.0 → 1.27.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 +12 -0
- package/dist/waveform-player-no-autoinit.cjs +3041 -0
- package/dist/waveform-player-no-autoinit.esm.js +64 -0
- package/dist/waveform-player.cjs +16 -11
- package/dist/waveform-player.esm.js +2 -2
- package/dist/waveform-player.js +15 -10
- package/dist/waveform-player.min.js +2 -2
- package/no-autoinit.d.ts +17 -0
- package/package.json +17 -3
- package/src/js/entry.js +143 -0
- package/src/js/index.js +34 -121
- package/src/js/utils.js +17 -0
package/README.md
CHANGED
|
@@ -54,6 +54,18 @@ WaveformPlayer.init( document.querySelector( '#my-app' ) );
|
|
|
54
54
|
|
|
55
55
|
Constructing players directly still works too; only the scan on import is suppressed.
|
|
56
56
|
|
|
57
|
+
That attribute is for pages. If you're **bundled into a page you don't author** — a CMS block, a plugin, a widget dropped into someone else's template — there's no `<html>` in scope to mark before your `import` is evaluated. Import the library without the scan instead:
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
import WaveformPlayer from '@arraypress/waveform-player/no-autoinit';
|
|
61
|
+
|
|
62
|
+
// Identical in every other way. Nothing is initialized until you say so:
|
|
63
|
+
WaveformPlayer.init( myContainer );
|
|
64
|
+
new WaveformPlayer( el, { url: 'track.mp3' } );
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Same class, same options, same `window.WaveformPlayer`; ships as ESM and CJS. Pick one entry point per bundle — each carries its own copy of the class and its own instance registry.
|
|
68
|
+
|
|
57
69
|
This scopes initialization — it isn't a sanitizer. `playIcon` / `pauseIcon` (and their `data-play-icon` / `data-pause-icon` equivalents) inject raw markup by design, for any player you do build. Untrusted content still needs sanitizing before it reaches the page.
|
|
58
70
|
|
|
59
71
|
## Documentation
|