For browsers not not yet supporting W3C Web Audio API the MIDIjs library falls back to conventional plugin-based methods to play MIDI files. However, some of the advanced features of MIDIjs are not supported or even cannot be supported in fallback mode.
Advantages of MIDIjs
Example 1: Playing MIDI files
Play Rock the Jukebox (Alan Jackson) Play Unchain my Heart (Bobby Sharp) Play Hinematov (Reiner Oberbeck) Play Woman in Love (Barbara Streisand)
Example2: Get MIDI File Playing Duration
Get Playing Durations (seconds)
Include MIDIjs into your website
Using MIDIjs to play MIDI files on your web site is as easy as this. Lets assume you have a MIDI file "hinematov.mid" on your website in a directory named "midi".
There are just two steps to let it play:
1. Include the following script statement into your page's header
2. Create a link to play the file
<a href="#" onClick="MIDIjs.play('midi/hinematov.mid');">Play hinematov.mid</a>
Optional: Provide a link to stop playback at any time
<a href="#" onClick="MIDIjs.stop();">Stop MIDI Playback</a>
More Detailed MIDIjs API Description
Browsers where MDIjs works with Web Audio API
The following browsers have been positively tested. If version x of a browser works you may assume, that version x+1 also works. These are the positive cases. However, I did not make a comprehensive test of all browsers and operating systems that exist.
- Safari on iPhone and iPad on iOS 7
- Google Chrome 31 on iOS 7
The following browsers are not supported by MIDIjs. If version x does not work you may assume, that version x-1 also does not work.