Replies: 6 comments 10 replies
-
This is the expected behaviour. WEBMIDI.js takes care of opening (and closing) ports for you. In fact, the Web MIDI API spec does not even require you to open an output port before sending to it because it will implicitly open it for you. The same goes for an input port. As soon as you attach a listener to it, the port is automatically opened. So, basically, you shouldn't worry about opening or closing ports. |
Beta Was this translation helpful? Give feedback.
-
I'm new to the scene so forgive me if I'm mistaken, but are you saying that all devices are auto-connected by default behavior? If so it should have the option to whitelist/blacklist devices for auto-connecting. |
Beta Was this translation helpful? Give feedback.
-
The library simply calls the lower-level If you find this not to be the case, the issue should be raised in the bug trackers for Chromium or Firefox. If you do raise the issue with them, please be so kind as to link it here for follow up. |
Beta Was this translation helpful? Give feedback.
-
This is an interesting observation. Are you saying that, as soon as you call |
Beta Was this translation helpful? Give feedback.
-
I see your point here. I mostly work on Mac OS and GNU/Linux so I haven't really stumbled upon that issue before. I looked at the code and I don't think it would be too hard to make the opening of the ports optional (barring any unforeseen side effects). Since the library attempts to make it easy to use MIDI on the web, it would still open the ports by default but I could add an option to the WebMidi.enable({openPorts: false}); I would then have to decide whether calling |
Beta Was this translation helpful? Give feedback.
-
Yes,
HRESULT STDMETHODCALLTYPE Invoke(ICoreWebView2 *sender, ICoreWebView2PermissionRequestedEventArgs *args) {
COREWEBVIEW2_PERMISSION_KIND kind;
args->get_PermissionKind(&kind);
if (kind == COREWEBVIEW2_PERMISSION_KIND_CLIPBOARD_READ) {
args->put_State(COREWEBVIEW2_PERMISSION_STATE_ALLOW);
}
if (kind == COREWEBVIEW2_PERMISSION_KIND_MIDI_SYSTEM_EXCLUSIVE_MESSAGES) {
args->put_State(COREWEBVIEW2_PERMISSION_STATE_ALLOW);
}
if (kind == COREWEBVIEW2_PERMISSION_KIND_AUTOPLAY) {
args->put_State(COREWEBVIEW2_PERMISSION_STATE_ALLOW);
}
if (kind == COREWEBVIEW2_PERMISSION_KIND_FILE_READ_WRITE) {
args->put_State(COREWEBVIEW2_PERMISSION_STATE_ALLOW);
}
if (kind == COREWEBVIEW2_PERMISSION_KIND_WINDOW_MANAGEMENT) {
args->put_State(COREWEBVIEW2_PERMISSION_STATE_ALLOW);
}
return S_OK;
} If I include
I'm going to start removing layers to see if I can make the behavior stop then follow up where most appropriate. |
Beta Was this translation helpful? Give feedback.
-
Hey everyone,
got a question about whether this behaviour is intentional. I got a single output device and it seems that every time, WebMidi.enable() starts with that output state = "connected". I can then call close() and restart the application, and will again have that output "connected".
Is that expected? Is that even something under the control of WebMidi? it would seem more natural to me to start with all-disconnected outputs (and inputs) - also, would that auto-connect all outputs?
tested from a current Chrome (Windows).
best,
qm210
Beta Was this translation helpful? Give feedback.
All reactions