Coder Social home page Coder Social logo

ch4ot1c / lightning-jukebox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elementsproject/lightning-jukebox

0.0 1.0 0.0 50 KB

A Lightning powered Jukebox :zap: Pay with Bitcoin to choose your music.

Home Page: https://blockstream.com/2018/03/28/lightning-jukebox-offers-a-fun-end-to-our-week-of-lapps.html

License: MIT License

Shell 2.14% JavaScript 71.11% HTML 26.76%

lightning-jukebox's Introduction

Lightning Jukebox

npm release MIT license Pull Requests Welcome IRC

A Lightning powered Jukebox. Pay with Bitcoin to choose your music from YouTube.

See it in action on YouTube

Powered by โšก Lightning Charge

HOWTO

  1. Setup Lightning Charge.

  2. Install Lightning Jukebox and start jukeboxd:

    $ npm install -g lightning-jukebox
    
    $ jukeboxd --charge-token mySecretToken --price '0.0001 BTC'
    Jukebox server running on http://localhost:6100

    You may pick a different theme from bootswatch by specifying --theme [name] (the default is darkly).

  3. Navigate to http://localhost:6100/ on the computer playing the music and click Spawn YouTube player. This will open a new YouTube window in a new tab. Make sure to keep both the page on localhost:6100 and the youtube window open. You can use the YouTube window to start playing some initial music.

  4. Make the payment page (http://localhost:6100/pay) available over the internet or set it up on a local device, like a tablet, near the jukebox. The payment page allows users to pay for music selection.

    Once a payment is made, a push notification will be sent to the player window (via websockets), which will open the requested song in the spawned youtube window.

    Payments can also be made directly to the jukebox API:

    # with a search string
    $ BOLT11=`curl http://localhost:6100/invoice -d video='are you shpongled full album'`
    $ lightning-cli decodepay $BOLT11
    $ lightning-cli pay $BOLT11
    
    # with a specific video id
    $ lightning-cli pay `curl http://localhost:6100/invoice \
                         -d video=https://www.youtube.com/watch?v=IDiZG-eAk30`

CLI options

$ jukeboxd --help

  A Lightning powered Jukebox

  Usage
    $ jukeboxd [options]

  Options
    -c, --charge-url <url>      lightning charge server url [default: http://localhost:9112]
    -t, --charge-token <token>  lightning charge access token [required]

    -P, --price <price>         price to play music [default: 0.0001 BTC]
    -m, --theme <name>          pick theme from bootswatch.com [default: darkly]
    -l, --title <name>          website title [default: Lightning Jukebox]

    -p, --port <port>           http server port [default: 9115]
    -i, --host <host>           http server listen address [default: 127.0.0.1]
    -h, --help                  output usage information
    -v, --version               output version number

  Example
    $ jukeboxd -t chargeSecretToken -P '0.0005 EUR'

Why a separate YouTube tab instead of embedding the video player?

So that "auto play next" works.

License

MIT

lightning-jukebox's People

Contributors

shesek avatar

Watchers

Jon Layton 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.