Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions js/midi/audioDetect.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,9 @@ if (typeof MIDI === 'undefined') MIDI = {};
};

root.audioDetect = function(onsuccess) {
/// detect jazz-midi plugin
/// detect WebMIDI support, native or by jazz-midi plugin
if (navigator.requestMIDIAccess) {
var isNative = Function.prototype.toString.call(navigator.requestMIDIAccess).indexOf('[native code]');
if (isNative) { // has native midiapi support
supports['webmidi'] = true;
} else { // check for jazz plugin midiapi support
for (var n = 0; navigator.plugins.length > n; n ++) {
var plugin = navigator.plugins[n];
if (plugin.name.indexOf('Jazz-Plugin') >= 0) {
supports['webmidi'] = true;
}
}
}
supports['webmidi'] = true;
}

/// check whether <audio> tag is supported
Expand Down