diff --git a/build/MIDI.js b/build/MIDI.js index ef200e04..73f8283c 100644 --- a/build/MIDI.js +++ b/build/MIDI.js @@ -11,92 +11,93 @@ if (typeof MIDI === 'undefined') MIDI = {}; -(function(root) { 'use strict'; - - var supports = {}; // object of supported file types - var pending = 0; // pending file types to process - var canPlayThrough = function (src) { // check whether format plays through - pending ++; - var body = document.body; - var audio = new Audio(); - var mime = src.split(';')[0]; - audio.id = 'audio'; - audio.setAttribute('preload', 'auto'); - audio.setAttribute('audiobuffer', true); - audio.addEventListener('error', function() { - body.removeChild(audio); - supports[mime] = false; - pending --; - }, false); - audio.addEventListener('canplaythrough', function() { - body.removeChild(audio); - supports[mime] = true; - pending --; - }, false); - audio.src = 'data:' + src; - body.appendChild(audio); - }; - - root.audioDetect = function(onsuccess) { - /// detect 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; - } - } - } - } +(function(root) { + 'use strict'; + + var supports = {}; // object of supported file types + var pending = 0; // pending file types to process + var canPlayThrough = function(src) { // check whether format plays through + pending++; + var body = document.body; + var audio = new Audio(); + var mime = src.split(';')[0]; + audio.id = 'audio'; + audio.setAttribute('preload', 'auto'); + audio.setAttribute('audiobuffer', true); + audio.addEventListener('error', function() { + body.removeChild(audio); + supports[mime] = false; + pending--; + }, false); + audio.addEventListener('canplaythrough', function() { + body.removeChild(audio); + supports[mime] = true; + pending--; + }, false); + audio.src = 'data:' + src; + body.appendChild(audio); + }; + + root.audioDetect = function(onsuccess) { + /// detect 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; + } + } + } + } - /// check whether