--- title: MIDIConnectionEvent slug: Web/API/MIDIConnectionEvent tags: - API - Draft - MIDI - 接口 translation_of: Web/API/MIDIConnectionEvent ---
{{APIRef("Web MIDI API")}}{{SeeCompatTable}}
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. 例如,这个事件无论是在一个 MIDI 设备插入或拔出设备时都会触发。
MIDIConnectionEvent
对象。
规范 | 状态 | 备注 |
---|---|---|
{{SpecName('WebMIDI API','#midiconnectionevent-interface')}} | {{Spec2('WebMIDI API')}} | Initial definition. |
{{Compat("api.MIDIConnectionEvent")}}