This is the Pilot 1 Trial 1 music app. It runs on Node.JS/Express.JS.
You run it by executing from the app root dir:
npm start
See package.json
for dependencies.
You may install them from the app root dir using:
npm install
It streams audio files to the client's browser using HTML5.
The audio files must exist and be present on the computer (Linux).
Currently the path is hardcoded in the app.js
script.
The music app expects a directory parameter. Inside that directory the following tree must be used:
/
genre_1/
/song_a.mp3
/song_b.mp3
/...
genre_2/
/song_a.mp3
/song_b.mp3
/...
Right now, there is NO MARVIN communication. Interfacing with Marvin has the following format:
{
command : { "option" : "param" }
}
The possible options are:
genres
(without param) will redirect togenres
viewplay
with a required param used as thesong name
menu
(without param) will redirect user interface back to main menu
The app requires that we hardcode the Windows IP/URL of the UI in order to navigate
back to it when user presses Menu
.
We use the browserify
npm package to convert Node.JS scripts into script.dist.js
for the browser sandbox.
Browserified scripts (script.dist.js
) can be further minified using npm node-minifier
.
Chrome and Chromium (and maybe other broswers) using CORS do not allow browser scripts to communicate with different destinations (ip:port) other than the one from which they originated.
Because Marvin runs on a different port (and/or ip) the browser requires a plugin
which disables CORS: Allow-Control-Allow-Origin