Optional playout engines + injectable PlayoutAdapter (browser v14.0.0)
@waveform-playlist/browser@14.0.0 makes the audio engine optional and injectable. Tone.js and the playout packages are no longer hard dependencies, so MediaElement-only and custom-adapter consumers no longer bundle them. PR #510.
Published packages
| Package | Version |
|---|---|
@waveform-playlist/browser |
14.0.0 |
Breaking changes
tone, @waveform-playlist/playout, @waveform-playlist/media-element-playout are now optional peer dependencies
They are declared in peerDependenciesMeta as optional and no longer arrive transitively. If you use the default Tone-based playout, install the peers explicitly:
npm install tone @waveform-playlist/playoutOr inject your own backend instead (see "New" below).
The Tone-coupled surface moved to @waveform-playlist/browser/tone
The core @waveform-playlist/browser entry is now engine-free under every bundler. The batteries-included Tone exports moved to the /tone subpath: useAudioTracks, useDynamicTracks, the effects hooks (useDynamicEffects, useTrackDynamicEffects) plus the effect factory/definitions, useExportWav, ExportWavButton, useOutputMeter, and useMasterAnalyser.
- import { useAudioTracks, ExportWavButton } from '@waveform-playlist/browser';
+ import { useAudioTracks, ExportWavButton } from '@waveform-playlist/browser/tone';The Tone convenience re-export was removed
Import Tone directly:
- // previously re-exported from @waveform-playlist/browser
+ import * as Tone from 'tone';New
Injectable adapters
WaveformPlaylistProvideracceptscreateAdapter?: () => PlayoutAdapter.MediaElementPlaylistProvideracceptscreatePlayout?: () => MediaElementPlayout.
When supplied, no default engine is imported at all. When omitted, the default engine is loaded lazily via dynamic import(), with an actionable install-hint error if the optional peer is missing.
onError prop on both providers
Surfaces async engine-load / playout failures (e.g. a missing optional peer) to the consumer instead of throwing into the void.
Also shipped in this line
useAnnotationKeyboardControlsis now usable without aWaveformPlaylistProvider(#509).- Cross-package peer dependencies publish as caret ranges to avoid exact-pin deadlock (#508).
- New example: a MediaElement-only React starter that depends on neither
playoutnortone.
Migration summary
- Using the default Tone playout?
npm install tone @waveform-playlist/playout. - Update Tone-coupled imports to
@waveform-playlist/browser/tone. - Replace any
Toneimport from@waveform-playlist/browserwithimport * as Tone from 'tone'. - MediaElement-only or custom-adapter consumers can now drop
tone/playoutfrom their bundle entirely.