ihap
v0.0.12
Published
independent html5 audio player
Downloads
18
Readme
independent html5 audio player
HTML5 audioplayer plugin
Features
- no dependencies
- lightweight
- highly customizable
Setup
Installation
Install via npm
npm install ihap --save
or download the plugin manually
dist/js/ihap.min.js # js
dist/css/ihap.css # styles
Setup
Use your favourite module loader
import ihap from 'ihap';
// or
var ihap = require('ihap');
// or whatever
or include js & css directly into your HTML
<!-- include the ihap javascript -->
<script src="ihap.js"></script>
<!-- include the styles -->
<link rel="stylesheet" href="ihap.css">
Add required markup
Make sure you have at least a container div for the player in your markup
<div id="audioplayer_container"></div>
If you want to use the visual playlist then create a container for that, too
<div id="playlist_container"></div>
Initialize the plugin
<script>
var player = new Ihap({
settings: {
container: 'audioplayer_container' // use your id
},
songs: [
{
title: 'Song title',
id: '1',
artist: 'Song artist',
url: 'Song url'
}
]
});
</script>
See the wiki for a complete list of options and the API.
Contributing and development
- Fork the project ( https://github.com/cars10/ihap/fork )
- run
npm install
- run
npm run dev
to start the build task - Create your feature branch (
git checkout -b feature
) - Create your feature and write specs for it
- Run the specs
npm test
- Commit your changes (
git commit -am 'added new feature'
) - Push the branch (
git push origin feature
) - Create a new pull request