Directory

← Back

polymer-midi-player

MIDI Player Web Component

Author

Contributors

Rating

polymer-midi-player

npm Published on webcomponents.org

MIDI Player Web Component

midi-player

Playing MIDI files via Web Audio and Web MIDI

Usage

Install the Web Component

npm install polymer-midi-player --save

HTML

<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script type="module">
  import 'polymer-midi-player';
</script>
<midi-player src="test.mid" loop=2 autoplay></midi-player>

Attributes

src - MIDI file URL
data - contents of the MIDI file as String; can be used as an alternative to src
autoplay - start playback immediately
loop - the number of repeats, or true for an infinite loop

API

play()
pause()
resume()
stop()

Testing with Polymer

Make sure the Polymer CLI is installed: npm install -g polymer-cli
In the project directory:
run npm install
run polymer serve --open

Non-Polymer version

https://github.com/jazz-soft/JZZ-gui-Player

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Dependencies

  • @polymer/polymer#^3.1.0
  • @webcomponents/webcomponentsjs#^2.1.3
  • jzz#^0.7.3
  • jzz-gui-player#^1.2.3
  • jzz-midi-smf#^1.1.6
  • jzz-synth-tiny#^1.0.9
Released
2019-04-08
Maturity
IMPORTED
License
MIT License

Compatibility

Framework
Polymer 3.0+
Browser
Browser Independent
Online