mirror of
https://github.com/captbaritone/webamp.git
synced 2026-08-01 14:33:38 +00:00
Make hotkeys optional
This commit is contained in:
parent
f74bb1bc41
commit
c3e90c2133
2 changed files with 11 additions and 4 deletions
|
|
@ -51,6 +51,7 @@ Raven.context(() => {
|
|||
{ url: xmms, name: "XMMS Turquoise " },
|
||||
{ url: zaxon, name: "Zaxon Remake" }
|
||||
],
|
||||
enableHotkeys: true,
|
||||
__initialState: initialState
|
||||
});
|
||||
|
||||
|
|
|
|||
14
js/winamp.js
14
js/winamp.js
|
|
@ -38,24 +38,30 @@ class Winamp {
|
|||
|
||||
constructor(options) {
|
||||
this.options = options;
|
||||
const {
|
||||
initialTracks,
|
||||
avaliableSkins,
|
||||
enableHotkeys = false
|
||||
} = this.options;
|
||||
|
||||
this.media = new Media();
|
||||
this.store = getStore(this.media, this.options.__initialState);
|
||||
|
||||
this.store.dispatch(setSkinFromUrl(this.options.initialSkin.url));
|
||||
|
||||
const { initialTracks } = this.options;
|
||||
if (initialTracks) {
|
||||
this.store.dispatch(loadMediaFiles(initialTracks, LOAD_STYLE.BUFFER));
|
||||
}
|
||||
if (this.options.avaliableSkins) {
|
||||
if (avaliableSkins) {
|
||||
this.store.dispatch({
|
||||
type: SET_AVALIABLE_SKINS,
|
||||
skins: this.options.avaliableSkins
|
||||
skins: avaliableSkins
|
||||
});
|
||||
}
|
||||
|
||||
new Hotkeys(this.store.dispatch);
|
||||
if (enableHotkeys) {
|
||||
new Hotkeys(this.store.dispatch);
|
||||
}
|
||||
}
|
||||
|
||||
async renderWhenReady(node) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue