No description
Find a file
2018-02-19 20:46:54 -08:00
css Add winamp2-js id ourselves to ensure CSS namespacing works everywhere 2018-02-19 20:08:53 -08:00
experiments Ignore skin screenshots 2018-02-19 10:10:18 -08:00
js Exclude Raven from the UMD bundle 2018-02-19 20:18:55 -08:00
mp3 Fix corrupt mp3 2018-02-07 14:50:11 -08:00
scripts rm coverage after build 2018-01-31 21:03:48 -08:00
skins Dramatically improve handling of cursors 2018-01-24 09:15:47 -08:00
.babelrc Exclude polyfills from UMD build. 2018-02-17 21:55:54 -08:00
.eslintignore Update eslintignore 2017-10-17 20:00:09 -07:00
.eslintrc Add react lint rule re escape 2018-02-01 06:52:12 -08:00
.gitignore Add preview to repo 2017-05-10 17:36:15 -07:00
.htaccess Configure Allow-Origin in .htaccess 2018-01-03 23:38:15 -05:00
.travis.yml Disable broken weigh-in 2018-02-08 19:54:00 -08:00
favicon.ico Add favicon 2014-12-05 19:49:58 -08:00
features.md Document a few more feature 2018-01-25 19:59:33 -08:00
index.html Add winamp2-js id ourselves to ensure CSS namespacing works everywhere 2018-02-19 20:08:53 -08:00
library.html Refactor file loading 2018-02-19 17:16:25 -08:00
LICENSE.txt Add a license 2015-01-31 14:53:04 -08:00
package.json Bump version 2018-02-19 20:12:03 -08:00
press.md Add gigazine press link 2018-02-19 10:39:16 -08:00
preview.png Add preview to repo 2017-05-10 17:36:15 -07:00
README.md Refactor file loading 2018-02-19 17:16:25 -08:00
skin.html Fix eq title buttons 2017-09-07 21:48:14 -07:00
webpack.config.js Add source maps in dev 2017-11-02 08:00:55 -07:00
webpack.library.config.js Move NPM repo to production mode. Add minified version. 2018-02-19 20:46:54 -08:00
webpack.production.config.js Clean up import order 2018-01-03 19:52:00 -08:00
yarn.lock Exclude polyfills from UMD build. 2018-02-17 21:55:54 -08:00

Travis Codecov

Winamp2-js

Join the chat at https://gitter.im/winamp2-js/Lobby

A reimplementation of Winamp 2.9 in HTML5 and JavaScript. As seen on TechCrunch, Motherboard, Gizmodo, Hacker News (1, 2, 3), and elsewhere.

Give it a try!

Screenshot of Winamp2-js

Works in modern versions of Edge, Firefox, Safari and Chrome. IE is not supported.

Features

  • Decodes the actual skin file in your browser so you can load your favorite Winamp 2 skins!
  • Load local audio or skin files via drag-and-drop, eject button, or "options" button (upper left-hand corner)
  • Both visualization modes: oscilloscope and spectrum
  • Hotkeys
  • "Shade" mini-mode
  • "Doubled" mode, where the main window is twice as large: Ctrl-D

A more detailed list of features can be found in features.md.

Use Winamp2-js in your project PRE ALPHA

There are many websites that could potentially benefit from having Winamp embeded in them. That said, nobody that I know of is really doing this in production. In an attempt to try this out, I have published Winamp2-js as an NPM package. The API is far from stable as I don't actually know all the various use-cases it should support. Some potential ones are:

  • A player that can load files from Dropbox using the Dropbox JavaScript SDK.
  • A player that comes preloaded with a SoundCloud playlist.
  • A player that's compatible with [https://github.com/justinfrankel/WHUMP] database files.
  • A player that can be used to demonstrate skins on a skins website.
  • A generic podcast widget.
  • Something else?

You can attempt to use it in your JS project like so:

Install the package:

npm install --save winamp2-js

Create a DOM element somewhere in your HTML document:

<div id='winamp2-js'></div>

Initialize Winamp2-js in your JavaScript:

import Winamp from 'winamp2-js';

const winamp = new Winamp({
  initialTracks: [{
    metaData: {
      artist: "DJ Mike Llama",
      title: "Llama Whippin' Intro",
    },
    url: "https://d38dnrh1liu4f5.cloudfront.net/projects/winamp2-js/mp3/llama-2.91.mp3"
  }],
  initialSkin: {
    url: "https://d38dnrh1liu4f5.cloudfront.net/projects/winamp2-js/skins/base-2.91.wsz"
  }
});
// Render after the skin has loaded.
winamp.renderWhenReady(document.getElementById('winamp2-js'));

Notes:

  • This should not be considered "production" code.
    • Winamp2-js does not support Internet Explorer.
    • Winamp2-js was built to run on its own page, it may not play well with surrounding CSS.
  • Skin and audio URLs are subject to CORS. Please ensure they are either served from the same domain, or that the other domain is served with the correct headers.
  • This API is subject to change at any time.
  • Please reach out to me. I'd love to help you set it up, and understand how it's being used. I plan to expand this API as I learn how people want to use it.

Development

yarn
# Or: npm install
npm start

Open http://localhost:8080/webpack-dev-server/ in your browser.

Building

npm install
npm run build
npm run serve

Open the local ip/port that is output to the console in your browser.

Deploying

These commands assume you have an SSH key to my server, which you probably don't have. Feel free to adapt them to your own server.

npm run deploy

Reverting

npm run revert # Reverts quickly to the previous deploy
HASH=<SOME_GIT_HASH> npm run deploy # Runs a new deploy at a given hashlike.

Advanced Usage

There are some "feature flags" which you can manipulate by passing a specially crafted URL hash. Simply supply a JSON blob after the # of the URL to change these settings:

  • skinUrl (string) Url of the default skin to use. Note, this file must be served with the correct Allows Origin header.
  • audioUrl (string) Url of the default audio file to use. Note, this file must be served with the correct Allows Origin header.
  • hideAbout (boolean) Selectively hide the byline and GitHub link at the bottom of the page. Useful for taking screenshots.
  • initialState (object) Override the initial Redux state. Values from this object will be recursively merged into the actual default state.

Note: These are intended mostly as development tools and are subject to change at any time.

Reference

Predecessors

  • Webamp2x An impressive implementation from 2002(!).

  • JsAmp An implementation from 2005 by @twm (via Hacker News).

  • LlamaCloud Comp From 2011 by Lee Martin (via Twitter)

  • Winamp em HTML5 e Javascript In 2010 a developer named Danilo posted one of his HTML5 experiments: "an audio player simulating good old Winamp". You will have to download the zip file.

  • JuicyDrop An HTML5 implementation with less emphasis on being true to the skin, but fully featured visualizations. @cggaurav is keeping it alive on GitHub

  • Spotiamp The folks at Spotify reimplemented Winamp as a frontend for Spotify. Not in a browser, and only runs on Windows.

Thanks

  • Research and feature prototyping: @PAEz
  • Beta feedback, catching many small UI inconsistencies: LuigiHann
  • Beta feedback and insider answers to obscure Winamp questions: Darren Owen

Thank you to Justin Frankel and everyone at Nullsoft for Winamp which inspired so many of us.

License

While the Winamp name, interface, and, sample audio file are surely property of Nullsoft, the code within this project is released under the MIT License. That being said, if you do anything interesting with this code, please let me know. I'd love to see it.