0.2.0 • Published 3 years ago

microne v0.2.0

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

Screenshot

A tiny, minimalistic JS music player. It's around 2 kilobytes and it's super beautiful.

Installation

From CDN

Include with <script src="https://unpkg.com/microne/microne.js"></script>

npm

  • $ npm i microne
  • Include with <script src="node_modules/microne/microne.js"></script>

Manual

Simply download the microne.js file and include it.

Usage

<body>
  <div id="player"></div>

  <script src="https://unpkg.com/microne/microne.js"></script>
  <script>
    var m = new Microne(document.getElementById('player'))
    m.source('media/example.mp3')
  </script>
</body>

API

new Microne(parent_el)

Makes a new player and appends it to the parent_el element. parent_el must have a specified width and height and microne fills it.

m.source(href[, preload])

Sets the source of the player to href. If preload (optional) is false the audio will only be loaded at play. Default is true.

m.play()

Start playing.

m.pause()

Pause playing.

m.on(event, handler)

Add an event to the audio element. See possible events here.

0.2.0

3 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago