mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 10:15:31 +00:00
Add loadTrackUrl to winamp
This commit is contained in:
parent
9d63f541d9
commit
e387340d5c
2 changed files with 10 additions and 2 deletions
|
|
@ -47,7 +47,7 @@ Initialize Winamp2-js in your JavaScript:
|
|||
import 'babel-polyfill';
|
||||
import Winamp from 'winamp2-js';
|
||||
|
||||
new Winamp({
|
||||
const winamp = new Winamp({
|
||||
initialTrack: {
|
||||
name: "1. DJ Mike Llama - Llama Whippin' Intro",
|
||||
url: "https://d38dnrh1liu4f5.cloudfront.net/projects/winamp2-js/mp3/llama-2.91.mp3"
|
||||
|
|
@ -55,7 +55,11 @@ new Winamp({
|
|||
initialSkin: {
|
||||
url: "https://d38dnrh1liu4f5.cloudfront.net/projects/winamp2-js/skins/base-2.91.wsz"
|
||||
}
|
||||
}).render(document.getElementById('winamp2-js'));
|
||||
});
|
||||
winamp.render(document.getElementById('winamp2-js'));
|
||||
|
||||
// In response to a user selecting a track from your UI:
|
||||
winamp.loadTrackUrl(url, name);
|
||||
```
|
||||
|
||||
*Notes:*
|
||||
|
|
|
|||
|
|
@ -55,6 +55,10 @@ class Winamp {
|
|||
|
||||
new Hotkeys(this.fileInput, this.store);
|
||||
}
|
||||
|
||||
loadTrackUrl(url, name) {
|
||||
this.store.dispatch(loadMediaFromUrl(url, name));
|
||||
}
|
||||
}
|
||||
|
||||
export default Winamp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue