AudioControls simple lightweight jQuery plugin, helps you to create your own audio player, playlist and additional features.
- Audio Repeat
- Shuffle Playlist
- Repeat Audio
- Repeat Playlist
- Audio Timer (Increment / Decrement)
- Seekable Track
- Buffer Loader & default player controls
- Easy to integrate
- Suitable for maximum themes
- Extended API's and Events
Include script after the jQuery library (unless you are packaging scripts somehow else):
Do not include the script directly from GitHub (http://raw.github.com/...). The file is being served as text/plain and as such being blocked in Internet Explorer on Windows 7 for instance (because of the wrong MIME type). Bottom line: GitHub is not a CDN.
Data attributes are heart of this plugin, attributes helps to detect and enables audio controls.
HTML attribute key must be data-attr
<a href="#" class="play" data-attr="playPauseAudio"></a>
This will enable Play and Pause control for the anchor tag.
Enables Play, Pause control and activates css class playAudio or pauseAudio vice versa.
Enables next audio control, picks next audio from playlist and returuns disbaled class if there is no next audio from playlist.
Enables previous audio control, picks previous audio from playlist and returuns disbaled class if there is no previous audio from playlist.
Enables audio volume control, for now attribute support only it comes along with input range element
Ex: <input class="bar" data-attr="rangeVolume" type="range" />
Repeats current audio on done, return class repeatAudio if its active mode.
Enables audio timer either increment or decrement mode
Enables click event on track which will helps to jump audio positions
API's and Events
Starts playing audio if autoPlay is true
Expects HTML tag name where playlist items exists
Refers audio timer mode, possible values area decrement or increment
Expects CSS3 selector where progress bar need to be updated
If buffer as true, its start buffering audio even before audio play.
If shuffled as true, playlist has suffled on screen load.
Audio volume when initializing the player. It can be between 0.1 to 1
If loopPlaylist as true, playlist starts again from first once all audio completed.
For example please check demos
Fires on play button click
Fires on pause button click
Fires on audio volume change
Fires on every audio change