SonicFrame v1.3.2

Frame options

Every option of new SonicFrame(options). Only container is required; a strange value falls back to its default.

Options

Option Default What it does
container (required) The element to draw in.
media null An audio or video element to follow and control.
peaks null A list, { peaks, duration }, or a function that loads either.
duration null Seconds, used until the media knows its own.
bar see Drawings { width, gap, radius, minHeight, align, curve }, CSS pixels.
wave 'bars' A drawing's name, or { style, lineWidth, glow, mirror, smooth, knob }.
colors see Colors and CSS { wave, progress, hover, cursor, waveHover, progressHover, knob }.
cursorWidth 2 The cursor line's width, CSS pixels.
interact true Click, drag and keys seek; false makes a picture (role="img").
stepSeconds 5 Seconds moved by an arrow key (5 % while the length is unknown).
largeStepRatio 0.1 Part of the sound moved by Page Up / Page Down.
rewindOnEnd false Show the start again when the media ends.
lazy true Keep pixels and load peaks only near the screen.
animate true Bars grow in when peaks arrive (never with reduced motion).
zoom false true or the zoom options.
a11y {} Everything a screen reader hears, in the rows below.
a11y.lang 'en' The language of the frame's words and its plugins': 'en', 'pt', 'pt-PT', 'es', 'fr', a registered one or 'auto'; see Languages.
a11y.label 'Audio position' The accessible name, in the frame's language.
a11y.valueText 0:12 / 0:45 (time, ratio, duration) => string, the position in words.
a11y.zoom.announce, a11y.zoom.words false, the language's Say the new view after a zoom, and in which words; see Zoom.
plugins [] Plugins to start with.