media-element-playout: optional peaks (12.1.0)
@waveform-playlist/media-element-playout@12.1.0
Makes peaks optional so consumers can drive pure HTMLAudioElement playback (play / pause / seek / rate / timeupdate / ended) without supplying pre-computed waveform data — enabling headless and scrubber-only players (e.g. long-form radio streams that render a plain scrubber with no waveform).
Changes
MediaElementTrackOptions.peaksis now optional (peaks?: WaveformDataObject).MediaElementTrack.durationdegrades gracefully:audioElement.duration→peaks?.duration→0(no throw when peaks absent).MediaElementPlayout.sampleRatereturns the44100default when no peaks are present.get peaks()now returnsWaveformDataObject | null.- Adds the package's first unit suite (
vitest) covering the peaks-omitted path plus backward-compat with peaks provided.
Compatibility
- Runtime behavior with
peaksprovided is unchanged. The in-repo@waveform-playlist/browserconsumer (which always passes decoded peaks and never readstrack.peaks) is unaffected. - Type note:
get peaks()widening toWaveformDataObject | nullis a type-level change — external TypeScript consumers that read the getter and dereference it without a null guard will now need one. This drives the minor version bump (12.0.0 → 12.1.0).