npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@awesome-web-projects/music-player

v1.0.0

Published

Framework-agnostic audio player Web Components with multiple skins. Powered by @awesome-web-projects/audio-engine.

Downloads

48

Readme

@awesome-web-projects/music-player

Framework-agnostic audio player Web Components with multiple skins. Drop-in custom elements with Shadow DOM encapsulation — works in any framework or plain HTML. Powered by @awesome-web-projects/audio-engine.

Features

  • 5 player skins: Circular, Minimal, Waveform, Vinyl, and Glass
  • Standard Web Components (customElements.define) — no framework lock-in
  • Shadow DOM for full style encapsulation
  • Canvas-based audio visualizers (circular, waveform, glass)
  • Streaming audio loading via Web Workers
  • Partial loading — starts playing in seconds, preloads the full song in the background
  • Keyboard shortcuts (Space, N, B)
  • Configurable colors and volume
  • Full TypeScript support with exported types

Installation

npm install @awesome-web-projects/music-player

Usage

HTML

<script type="module">
  import '@awesome-web-projects/music-player';
</script>

<music-player-circular color="rgba(97, 218, 251, 0.8)"></music-player-circular>

<script>
  const player = document.querySelector('music-player-circular');
  player.tracks = [
    { name: 'Song One', artist: 'Artist A', url: '/songs/one.mp3' },
    { name: 'Song Two', artist: 'Artist B', url: '/songs/two.mp3' },
  ];
</script>

JavaScript / TypeScript

import { defineCircularPlayer, CircularPlayerElement } from '@awesome-web-projects/music-player';

// Elements are auto-registered on import, but you can also register individually:
// defineCircularPlayer();

const player = document.createElement('music-player-circular') as CircularPlayerElement;
player.tracks = [
  { name: 'Song One', artist: 'Artist A', url: '/songs/one.mp3' },
  { name: 'Song Two', artist: 'Artist B', url: '/songs/two.mp3' },
];
player.setAttribute('color', 'rgba(97, 218, 251, 0.8)');
document.body.appendChild(player);

Framework Integration

Works in React, Vue, Svelte, Angular, or any framework that supports custom elements:

// React example
function App() {
  const playerRef = useRef<HTMLElement>(null);

  useEffect(() => {
    if (playerRef.current) {
      (playerRef.current as any).tracks = [
        { name: 'Song', artist: 'Artist', url: '/song.mp3' },
      ];
    }
  }, []);

  return <music-player-minimal ref={playerRef} color="rgba(97, 218, 251, 0.8)" />;
}

Available Elements

| Element | Tag | Description | |---------|-----|-------------| | CircularPlayerElement | <music-player-circular> | Circular visualizer with frequency bars around a disc | | MinimalPlayerElement | <music-player-minimal> | Clean, compact player with progress bar | | WaveformPlayerElement | <music-player-waveform> | Waveform bar visualizer | | VinylPlayerElement | <music-player-vinyl> | Spinning vinyl disc animation | | GlassPlayerElement | <music-player-glass> | Frosted glass effect with frequency bars |

Attributes

| Attribute | Type | Default | Description | |-----------|------|---------|-------------| | color | string | 'rgba(97, 218, 251, 0.8)' | Primary color for the player UI | | initial-volume | string | '0.5' | Initial volume (0-1) | | thread | 'main' \| 'worker' | 'worker' | Audio fetching strategy | | enable-keyboard | 'true' \| 'false' | 'true' | Enable keyboard shortcuts |

Properties

| Property | Type | Description | |----------|------|-------------| | tracks | Track[] | Array of tracks (set via JavaScript, not attribute) |

Track

interface Track {
  name: string;
  artist: string;
  url: string;
}

Keyboard Shortcuts

| Key | Action | |-----|--------| | Space | Play / Pause | | N | Next track | | B | Previous track |

Selective Registration

By default, all elements are registered on import. To register only specific elements:

import { defineCircularPlayer } from '@awesome-web-projects/music-player';

defineCircularPlayer(); // Only registers <music-player-circular>

Available registration functions: defineCircularPlayer, defineMinimalPlayer, defineWaveformPlayer, defineVinylPlayer, defineGlassPlayer, defineAllPlayers.

Related Packages

Development

npm install
npm run dev          # Start demo dev server
npm run build        # Build library
npm run build:demo   # Build demo page
npm run typecheck    # Type check

License

MIT