An event-driven headless music player without a UI https://examples.nomercy.tv/musicplayer
  • TypeScript 97.7%
  • JavaScript 1.8%
  • HTML 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-04 19:26:22 +02:00
.github/workflows chore(release): promote nomercy-music-player to stable 2.0.1 2026-07-18 03:05:31 +02:00
e2e feat(music-player): v1 compatibility plugin (single-file, opt-in, deprecated shims) 2026-07-02 21:22:12 +02:00
scripts feat(music): API unification consolidation — v2 RC (2.0.0-rc.19) 2026-06-30 03:34:16 +02:00
src fix(auth): the audio backends ask per url again 2026-08-04 19:18:32 +02:00
.gitattributes chore: add .gitattributes for consistent line endings 2026-03-16 05:52:46 +01:00
.gitignore feat(music): API unification consolidation — v2 RC (2.0.0-rc.19) 2026-06-30 03:34:16 +02:00
CHANGELOG.md chore(release): promote nomercy-music-player to stable 2.0.1 2026-07-18 03:05:31 +02:00
CLAUDE.md docs: state auto-advance opt-in asymmetry vs video player 2026-07-09 22:24:38 +02:00
CODE_OF_CONDUCT.md chore(music-player): publish-prep — files trim + CoC/CONTRIBUTING/SECURITY 2026-05-16 18:40:07 +02:00
CONTRIBUTING.md feat(music): API unification consolidation — v2 RC (2.0.0-rc.19) 2026-06-30 03:34:16 +02:00
eslint.config.js chore(lint): enforce eslint-plugin-player boundary rules 2026-07-05 05:45:22 +02:00
LICENSE Refactor audio motion analyzer implementation and update type definitions for better clarity and consistency 2025-01-04 11:58:32 +01:00
MIGRATION.md docs(migration): repoint dead migrate-from-v1 doc link 2026-07-10 06:04:35 +02:00
package-lock.json chore(deps): core 2.0.4, for the per-url media provider 2026-08-04 19:26:22 +02:00
package.json chore(deps): core 2.0.4, for the per-url media provider 2026-08-04 19:26:22 +02:00
playwright.config.ts feat(music): API unification consolidation — v2 RC (2.0.0-rc.19) 2026-06-30 03:34:16 +02:00
README.md docs(music): fix stale README doc links and order introduction-to-full-knowledge 2026-07-04 22:23:19 +02:00
RELEASING.md chore(music): refresh migration and release docs for 2.0.0 2026-07-04 03:49:53 +02:00
SECURITY.md chore(music-player): publish-prep — files trim + CoC/CONTRIBUTING/SECURITY 2026-05-16 18:40:07 +02:00
tsconfig.build.json build(music): emit .js extensions via tsc-alias, release rc.8 2026-06-28 18:46:12 +02:00
tsconfig.json style(lint): bulk autofix + manual fixes for full ruleset [skip ci] 2026-05-29 19:43:27 +02:00
vite.config.ts fix: standalone build resolution + apache-2.0 headers 2026-06-14 09:51:54 +02:00
vite.iife.config.ts fix(music): ship the IIFE bundle and align the CDN build with core's exports 2026-07-04 03:49:52 +02:00
vitest.config.ts test(config): CI's dependency resolution is reachable from inside the monorepo 2026-08-03 00:50:06 +02:00

npm license bundlephobia

Full documentation: https://docs.nomercy.tv/nomercy-music-player/

nomercy-music-player

The headless audio engine behind music on NoMercy TV.

It nails the hard part of a music player: the hand-off between two tracks.

You get plain events and methods, and you wire your own interface.

  • Sample-accurate crossfade, or a gapless transition straight into the next track
  • A full equalizer chain and synced lyrics
  • Queue and backlog control, repeat and shuffle, a typed event bus
  • Lock-screen and notification controls, plus auto-advance

Built on nomercy-player-core, the shared engine for the queue, auth, plugins, i18n, and storage.

Install

npm install @nomercy-entertainment/nomercy-music-player

Adaptive HLS audio streams play out of the box. The backend detects an .m3u8 source and streams it, falling back to native HLS where the platform supports it, and hls.js ships with the player core so there is nothing extra to install.

Quick start

import { nmplayer } from '@nomercy-entertainment/nomercy-music-player';
import { AutoAdvancePlugin, MediaSessionPlugin } from '@nomercy-entertainment/nomercy-music-player/plugins';

const player = nmplayer('main')
  .addPlugin(AutoAdvancePlugin)
  .addPlugin(MediaSessionPlugin)
  .setup({
    baseUrl: 'https://raw.githubusercontent.com/NoMercy-Entertainment/nomercy-media/master/Music',
    playlist: [
      {
        id: 'bent-wyre-01',
        name: 'Ants Of The Beat',
        url: '/B/bent%20wyre/%5B2025%5D%20If%20Only%20Life%20Was%20This%20Easy%20Volume%205%20-%20The%20Beat%20Misdirect/01%20Ants%20Of%20The%20Beat.mp3',
        artistTracks: [{ id: 1, name: 'bent wyre' }],
      },
    ],
  });

player.on('ready', () => {
  player.item(0, { autoplay: true });
});

AutoAdvancePlugin advances the queue when a track ends, and MediaSessionPlugin wires the lock-screen and notification controls.

Bring your own UI

No UI is bundled. Nothing is forced on you.

Crossfade and gapless playback are built in, called when you want them. Everything else, lyrics, the equalizer, media controls, auto-advance, key handling, is a plugin you opt into with addPlugin. Build your own interface from the player's events, the path the Build a Player tutorial walks one piece at a time.

You can also swap any built-in behavior. Pass your own storage, URL resolver, shuffle strategy, or logger to setup(). No subclassing.

Upgrading from v1

See MIGRATION.md for the full breaking-change list, including renamed methods, changed event payloads, and the item.path to item.url rename that breaks silently if missed. Group listening queue serialization is particularly sensitive to this change.

Documentation

The docs site is the full reference, ordered from first track to plugin author:

License

Apache-2.0

Repository: github.com/NoMercy-Entertainment/nomercy-music-player