Closed tjvg91 closed 6 years ago
I'm not too familiar with TypeScript. @TimMensch do you have any insight to this?
@tjvg91 If your using typescript you can just do import * as MidiPlayer from 'midi-player-js';
thanks @gciluffo but I get this error this time:
Error: Cannot find module 'fs'
Module 'fs' doesn't exist on the browser. You can't use the file API in the browser.
How can i do so? @TimMensch
Please don't ask questions until you have done a minimum of research yourself. The bare minimum in this case is reading the docs:
http://grimmdude.com/MidiPlayerJS/docs/Player.html#loadFile
See how it says loadFile() is Node.js only? That means it won't work in the browser. Look at the other options and choose one.
Is there a typescript counterpart for this? I plan to embed this in an Angular 4 project but I get this error:
ReferenceError: require is not defined