webmidi: Node ReferenceError: navigator is not defined
I’m running this code and it throws “ReferenceError: navigator is not defined”
var WebMidi = require('webmidi')
WebMidi.enable(function (err) {
if (err) {
console.log("WebMidi could not be enabled.", err);
} else {
console.log("WebMidi enabled!");
}
});
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 20 (14 by maintainers)
I made some progress. The code below will let you list input and output devices. It will also let you add listeners on inputs and try outputs.
This is more of a proof-of-concept than anything else. Do not use WebMidi.js + Node in production!
To use this code, you will need at least release 2.0.0-rc.7 of WebMidi.js which includes a tiny but important change.
Super helpful, thanks! Used the global navigator to sign in to AWS-Cognito for testing api with auth. 👍