An open API service indexing awesome lists of open source software.

https://github.com/kodedninja/microne

A tiny, minimalistic JS music player
https://github.com/kodedninja/microne

audio javascript minimalist music-player plugin

Last synced: 10 months ago
JSON representation

A tiny, minimalistic JS music player

Awesome Lists containing this project

README

          

![Screenshot](https://github.com/kodedninja/microne/blob/master/SCREENSHOT.png)

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

## Installation
### From CDN
Include with ``````

### npm
- ```$ npm i microne```
- Include with ``````

### Manual
Simply download the ```microne.js``` file and include it.

## Usage
```html



var m = new Microne(document.getElementById('player'))
m.source('media/example.mp3')

```

## 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.](https://www.w3schools.com/tags/ref_av_dom.asp)