Add a minimal example

This commit is contained in:
Jordan Eldredge 2018-03-28 22:37:28 -07:00
parent b0f5bfbde5
commit 0bf403bb28
3 changed files with 23 additions and 4 deletions

View file

@ -1,6 +1,12 @@
# Usage
Here's how to use Winamp-js in your own project:
Here's how to use Winamp-js in your own project.
## Examples
If you would like to look as some examples check out the [examples directory](../examples/) were you will find:
* [Minimal](../examples/minimal/) - An example that just uses a `<script>` tag that points to a CDN. No install required.
## Install

View file

@ -0,0 +1,13 @@
# Minimal Example
This example fetches the Winamp2-js bundle from a free CDN, and fetches the audio file and skin from a free CDN as well.
You should be able to open this local html file in your browser and see Winamp2-js working.
```
$ git clone git@github.com:captbaritone/winamp2-js.git
$ cd winamp2-js
$ open examples/minimal/index.html
```
Or just navigate to <https://cdn.rawgit.com/captbaritone/winamp2-js/master/examles/minimal/index.html>

View file

@ -7,7 +7,7 @@
<body>
<div id='app'></div>
<script src="./built/winamp.bundle.min.js"></script>
<script src="https://unpkg.com/winamp2-js@0.0.6/built/winamp.bundle.min.js"></script>
<script>
const Winamp = window.winamp2js;
new Winamp({
@ -16,10 +16,10 @@
artist: "DJ Mike Llama",
title: "Llama Whippin' Intro"
},
url: "./mp3/llama-2.91.mp3"
url: "https://cdn.rawgit.com/captbaritone/winamp2-js/43434d82/mp3/llama-2.91.mp3"
}],
initialSkin: {
url: "./skins/base-2.91.wsz"
url: "https://cdn.rawgit.com/captbaritone/winamp2-js/43434d82/skins/base-2.91.wsz"
},
}).renderWhenReady(document.getElementById('app'));
</script>