How to play a midi file in Firefox?

I would like to play midi files in Firefox.

For example, I'd like to click on the files on this Wikipedia page and have them play in the browser and not have to download them and use a separate player.

I did get a plugin for VLC to play them, but even when it is set to handle midi files in Firefox's preferences either Totem still opens (and does nothing) or VLC opens it in a separate window (depending on the setting).

Is there a cleaner way of playing them embedded in the browser?


Solution 1:

I know this isn't the answer you want, but modern browsers don't play midi files. To the best of my knowledge Mozilla dropped support for NPAPI plugins around the first quarter of 2017. Wikipedia makes this clear.

Music files may occasionally use the MIDI format (.MID or .MIDI extension). MIDI is often playable without additional software, and some PCs have a MIDI-enabled player and sound card. However, for macOS (since 10.9 Mavericks), a MIDI file is not playable by both Safari and QuickTime pre-installed in the system and an alternative standalone player has to be used. The situation is similar with modern Firefox and Google Chrome browsers which do not support MIDI by default but require additional software (plugins, extensions, codecs) to play such files.

One solution is to download and play them in totem (a.k.a Videos) Totem requires a plugin for this that it doesn't automatically find. The solution to THAT is to be found in the fluidsynth package.

Another option mentioned by doug in a comment above can be found here: Audacious: How to play midi files?

S number of popular MIDI files can be found here.

Sources:

https://support.mozilla.org/en-US/questions/1149132

https://en.wikipedia.org/wiki/Wikipedia:Media_help

Solution 2:

If you have Rhythmbox music player choose it instead of VLC. Rhythmbox can play MIDI files if fluid-soundfont-gm is installed. fluid-soundfont-gm can be installed from the default Ubuntu repositories in all currently supported versions of Ubuntu with the following command.

sudo apt install fluid-soundfont-gm

Solution 3:

This Firefox addon is fine answer to the problem in september 2019. after adding on and click midi link the midi player open right up.

https://addons.mozilla.org/en-US/firefox/addon/midi-player/

midi player add on for firefox