MIDIConnectionEvent: MIDIConnectionEvent() constructor
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The MIDIConnectionEvent() constructor creates a new MIDIConnectionEvent object. Typically this constructor is not used as events are created when a new port becomes available, and the object is passed to the statechange event.
Syntax
new MIDIConnectionEvent(type)
new MIDIConnectionEvent(type, midiConnectionEventInit)
Parameters
type-
A string with one of
"connect"or"disconnect". midiConnectionEventInitOptional-
A dictionary including the following fields:
port-
The
MIDIPortinstance representing the port that has connected or disconnected. bubblesOptional-
A boolean value indicating whether the event bubbles. The default is
false. cancelableOptional-
A boolean value indicating whether the event can be cancelled. The default is
false. composedOptional-
A boolean value indicating whether the event will trigger listeners outside of a shadow root (see
Event.composedfor more details). The default isfalse.
Specifications
| Specification |
|---|
| Web MIDI API> # dom-midiconnectionevent-constructor> |