{{APIRef("Web MIDI API")}}{{Non-standard_header()}}
The MIDIConnectionEvent
interface of the Web MIDI API is the event passed to the {{domxref("MIDIAccess.onstatechange","onstatechange")}} event of the {{domxref("MIDIAccess")}} interface and the {{domxref("MIDIPorts.onstatechange","onstatechange")}} event of the {{domxref("MIDIPorts")}} interface. This occurs any time a new port becomes available, or when a previously available port becomes unavailable. For example, this event is fired whenever a MIDI device is either plugged in to or unplugged from a computer.
Constructor
- {{domxref("MIDIConnectionEvent.MIDIConnectionEvent")}}
- Creates a new
MIDIConnectionEvent
object.
Properties
- {{domxref("MIDIConnectionEvent.port")}}
- Returns a reference to a {{domxref("MIDIPort")}} instance for a port that has been connected or disconnected."
Examples
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('WebMIDI API','#midiconnectionevent-interface')}} | {{Spec2('WebMIDI API')}} | Initial definition. |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatChrome(43.0)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatNo}} |