cifkao / html-midi-player

🎹 Play and display MIDI files on the web
https://cifkao.github.io/html-midi-player/
BSD 2-Clause "Simplified" License
630 stars 56 forks source link

Make Preload an option #10

Open e7mac opened 3 years ago

e7mac commented 3 years ago

Sometimes, when there are lots of MIDI Files displayed on a page, preloading them all might be undesirable. Could it be possible to make an option preload=False in the <midi-player> ?

cifkao commented 3 years ago

Good idea! Maybe something like preload="none" as in the <audio> element. Possibly preload="bare" to load only the MIDI file and not the sound font.

There should also be a clear indication in the UI (different icon?) that the player is loading, as opposed to a disabled or error state. Which is a good idea anyway.

e7mac commented 3 years ago

Ideas for the loading indicator: a "shimmer" on the whole player/timeline slider, or a progress bar on the timeline slider