GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - arraypress/waveform-player: Lightweight, customizable audio player with waveform visualization

BranchesTags
Open more actions menu

Latest commit

 

History

211 Commits
211 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
dist
dist
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CLAUDE.md
CLAUDE.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.d.ts
index.d.ts
 
 
no-autoinit.d.ts
no-autoinit.d.ts
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
vitest.config.ts
vitest.config.ts
 
 

Repository files navigation

WaveformPlayer

Zero-config audio waveforms for the web. Add a data- attribute to a <div> and get a real, interactive waveform player. No build step, no dependencies.

npm gzip license

Documentation · npm


Install

npm install @arraypress/waveform-player

Load from a CDN and it auto-initializes every [data-waveform-player] on the page:

<link rel="stylesheet" href="https://unpkg.com/@arraypress/waveform-player/dist/waveform-player.css">
<script src="https://unpkg.com/@arraypress/waveform-player/dist/waveform-player.min.js"></script>

<div data-waveform-player data-url="track.mp3" data-title="My Song" data-artist="The Artist"></div>

Or drive it from JavaScript:

import WaveformPlayer from '@arraypress/waveform-player';

new WaveformPlayer('#player', { url: 'track.mp3', title: 'My Song', artist: 'The Artist' });

Initializing only what you control

Pages that render markup they don't author — user content, a CMS, an editor canvas — can turn the automatic scan off from the document element:

<html data-waveform-autoinit="false">

Nothing is initialized until you ask for it. Pass init() a root to scan only the subtree you own:

WaveformPlayer.init( document.querySelector( '#my-app' ) );

Constructing players directly still works too; only the scan on import is suppressed.

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:

import WaveformPlayer from '@arraypress/waveform-player/no-autoinit';

// Identical in every other way. Nothing is initialized until you say so:
WaveformPlayer.init( myContainer );
new WaveformPlayer( el, { url: 'track.mp3' } );

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.

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.

Documentation

Every option, style, event and method is documented on the docs site.

-> docs.waveformplayer.com

Options · Waveform styles · Events · Methods · Accessibility

Extensions: Bar · Playlist · Tracker · Gen — Frameworks: React · Vue · Svelte · Astro

License

MIT © ArrayPress

About

Lightweight, customizable audio player with waveform visualization

waveformplayer.com

Topics

arraypressaudioaudio-peaksaudio-playeraudio-visualizationbpm-detectioncanvasmedia-sessionmusic-playerpodcast-playertypescriptvanilla-javascriptwaveformweb-audio-api

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

52 stars

Watchers

3 watching

Forks

7 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.