View on GitHub

UbaPlayer

The jQuery HTML5 Audio Player with Flash Fallback

Download this project as a .zip file Download this project as a tar.gz file

UbaPlayer 2.0.5

The jQuery HTML5 Audio Player with Flash Fallback.

UbaPlayer is a simple jQuery plugin that plays audio natively in modern browsers and uses Flash where native playback is impossible. It is tested to work in the following browsers:

Demo

Getting Started

Download the production version.

In your web page:

<!-- in the head tag -->
<link rel="stylesheet" href="css/styles.css" />

<!-- somewhere in the body tag -->
<div id="ubaplayer"></div>
<ul class="ubaplayer-controls">
    <li><a class="ubaplayer-button" href="media/foo.mp3">Foo</a></li>
</ul>

<!-- near closing body tag -->
<script src="js/jquery.min.js"></script>
<script src="js/jquery.ubaplayer.min.js"></script>
<script>
    $(function(){
        $("#ubaplayer").ubaPlayer();
    });
</script>

Documentation

Configuration Options & Their Defaults

defaults: {
    audioButtonClass: 'ubaplayer-button',
    autoPlay: null,
    codecs: [{
        name: 'OGG',
        codec: 'audio/ogg; codecs="vorbis"'
    }, {
        name: 'MP3',
        codec: 'audio/mpeg'
    }],
    continuous: false,
    controlsClass: 'ubaplayer-controls',
    extension: null,
    fallbackExtension: '.mp3',
    fallbackFunctions: {
        error: null,
        pause: null,
        play: null,
        resume: null
    },
    flashAudioPlayerPath: 'swf/player.swf',
    flashExtension: '.mp3',
    flashObjectID: 'ubaplayer-flash',
    loadingClass: 'ubaplayer-loading',
    loop: false,
    playerContainer: 'ubaplayer-container',
    playingClass: 'ubaplayer-playing',
    swfobjectPath: 'js/swfobject.js',
    volume: 0.5,
}

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style.

Also, please don't edit JS files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "src" subdirectory!

Release History

Release History

License

Copyright (c) 2014 Brian Hadaway Licensed under the MIT license.