Giter Site home page Giter Site logo

hobbit19 / winamp2-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from captbaritone/webamp

0.0 2.0 0.0 4.58 MB

A reimplementation of Winamp 2.9 in HTML5 and Javascript

Home Page: https://webamp.org

License: MIT License

JavaScript 88.98% CSS 7.64% Python 2.05% HTML 1.32%

winamp2-js's Introduction

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

Winamp2-js

A reimplementation of Winamp 2.9 in HTML5 and JavaScript.

As seen on TechCrunch, Motherboard, Gizmodo, Hacker News (1, 2, 3), and elsewhere.

Screenshot of Winamp2-js

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

Features

Check out this Twitter thread for an illustrated list of features: https://twitter.com/captbaritone/status/961274714013319168

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 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='app'></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"
  },
  enableHotkeys: true // Enable hotkeys
});
// Render after the skin has loaded.
winamp.renderWhenReady(document.getElementById('app'));

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

Travis runs the build and then pushes the contents of ./built to the gh-pages branch of this repository. GitHub Pages then serve that directory as https://webamp.org. CloudFlare sits in front of GitHub pages to provide the SSL certificate.

In short, deploying should be as simple as pushing a commit to master which builds, lints and passes all tests.

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.

winamp2-js's People

Contributors

awayken avatar captbaritone avatar cvaliente avatar durasj avatar fluorescenthallucinogen avatar gitter-badger avatar greenkeeperio-bot avatar idleberg avatar insin avatar lomanic avatar lostsource avatar paralax avatar rickycodes avatar rxl881 avatar sdanailo-42 avatar sethiroth66 avatar sophiebits avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.