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
- Host: GitHub
- URL: https://github.com/kodedninja/microne
- Owner: kodedninja
- License: mit
- Created: 2018-01-09T08:47:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-03-11T19:27:06.000Z (over 5 years ago)
- Last Synced: 2025-04-19T00:41:26.463Z (about 1 year ago)
- Topics: audio, javascript, minimalist, music-player, plugin
- Language: HTML
- Homepage: https://microne.now.sh/
- Size: 14.5 MB
- Stars: 37
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

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)