diff --git a/js/webamp.js b/js/webamp.js index e15ae127..7bd20896 100644 --- a/js/webamp.js +++ b/js/webamp.js @@ -10,7 +10,8 @@ import { getTrackCount } from "./selectors"; import { setSkinFromUrl, loadMediaFiles, - setWindowSize + setWindowSize, + loadFilesFromReferences } from "./actionCreators"; import { LOAD_STYLE } from "./constants"; import { uniqueId, objectMap, objectForEach } from "./utils"; @@ -77,6 +78,18 @@ class Winamp { type: navigator.onLine ? NETWORK_CONNECTED : NETWORK_DISCONNECTED }); + if (true) { + const fileInput = document.createElement("input"); + fileInput.id = "webamp-file-input"; + fileInput.style.display = "none"; + fileInput.type = "file"; + fileInput.value = null; + fileInput.addEventListener("change", e => { + this.store.dispatch(loadFilesFromReferences(e.target.files)); + }); + document.body.appendChild(fileInput); + } + this.genWindows = []; if (__extraWindows) { this.genWindows = __extraWindows.map(genWindow => ({