grimmdude / MidiPlayerJS

♬ MIDI parser & player engine for browser or Node. As a parser converts MIDI events into JSON. Works well with single or multitrack MIDI files.
https://grimmdude.com/MidiPlayerJS/
MIT License
357 stars 52 forks source link

“browser” folder - browserify fails #38

Closed jeniffer9 closed 5 years ago

jeniffer9 commented 5 years ago

Hi!

I have just a small question. In the index.html file you add a script with src=“browser/midiplayer.min.js“ but I cannot find the browser directory at all... how does this work? Also everytime I try to browserify midi-player-js, it fails with an error saying that it cannot find the files in the ‘browser’ folder because it doesn’t exist...

I would be very happy if someone could explain that to me. Thanks!

grimmdude commented 5 years ago

HI @jeniffer9,

Thanks for your message. The /browser directory is only available in the built package which can be installed using npm:

npm install midi-player-js

Let me know if you still have questions,

-Garrett

jeniffer9 commented 5 years ago

Thanks for your quick answer!

So now I tried npm install midi-player-js in /npm_modules of my project. However browserifying the module still doesn't work since it is looking for the ./player file inside /browser but the only two files located in /browser are midiplayer.js and midiplayer.min.js.

Is that normal?

-Jeniffer

grimmdude commented 5 years ago

HI Jeniffer,

The files in /browser are already browserified. You should be able to just use the midiplayer.min.js (minified version) in a script tag within your HTML. Does that answer your question?

-Garrett

jeniffer9 commented 5 years ago

Hi Garrett,

Yes, I think I got it now! Thank you very much! :)

Best, Jeniffer