Skip to content

Commit 48c502d

Browse files
committed
ask for permission to open midi device -- see #2661
1 parent 8e71694 commit 48c502d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

js/widgets/musickeyboard.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2941,8 +2941,11 @@ function MusicKeyboard() {
29412941
this.midiON = false;
29422942
}
29432943

2944-
navigator.requestMIDIAccess()
2945-
.then(onMIDISuccess, onMIDIFailure);
2944+
if (navigator.requestMIDIAccess)
2945+
navigator.requestMIDIAccess({ sysex: true })
2946+
.then(onMIDISuccess, onMIDIFailure);
2947+
else
2948+
logo.errorMsg(_("Failed to get MIDI access in browser."));
29462949
}
29472950

29482951
function fillChromaticGaps(noteList) {

0 commit comments

Comments
 (0)