Detect if a MIDI interface is connected in Web MIDI API
问题 I am experimenting with the Web Midi API in Chrome/OS X. So far I get good results but I am wondering: Is there a way to detect if a MIDI interface is connected/disconnected WHILE an application is running? The way it works for now is to restart the browser to let the application know that an interface is present or not ... There seems to be a MIDIAccess onconnect / ondisconnect event but I don't know what to do to make them fire. Is this implemented yet in Chrome (Canary)? 回答1: The current