What is it?
MooJuke is a plugin for MooTools that plays music (or any .mp3 for that matter). Slightly inspired by the simple design of iTunes, it allows you to make a list of songs to play like a jukebox on your site. You have control over the look and feel. Modifying the included css file (or making your own) will let it fit seamlessly into your site.
Download:
[download link coming soon]
View the Demo:
[demo link coming soon]
How do I use it?
Download and extract the files to a convenient location. Feel free to experiement with file locations, just keep in mind what you are putting where and update your link and script tags accordingly. MooJuke requires MooTools 1.2.3 or higher, the MooJuke script file (moojuke.js), the included stylesheet (moojuke.css), the Flash audio player (moojuke.swf), and two images (play.gif, play.png) for use when flash is not available. Once you have the files copied to your site, add the javascript and css files to your page head. Now it is “installed” on your site.
As for usage, it’s a simple as calling a new instance of MooJuke with the parameters that you want. Below is a sample of how you could setup MooJuke from the pagehead:
window.addEvent('domready', function(){
new MooJuke({
swf: 'flash/moojuke.swf',
container: 'jukebox',
autoplay: false,
continuous: false,
loop: false,
playcolor: '2d77b5',
loadcolor: 'ae3633',
songs: [
{name: 'Song 1', file: 'media/song1.mp3'},
{name: 'Song 2', file: 'media/song2.mp3'},
{name: 'Song 3', file: 'media/song3.mp3'},
{name: 'Song 4', file: 'media/song4.mp3'}
]
});
});
Parameters
| swf: | (string) path to swf file |
| container: | (string or object) containing element for the jukebox |
| autoplay: | (boolean) if true, starts first track on load |
| continuous: | (boolean) if true, once a track is complete, the next one will play |
| loop: | (boolean) if true AND “continuous” is true, will restart the list after the last track completes |
| playcolor: | (6 char hex) color of the progress wheel as track plays |
| loadcolor: | (6 char hex) color of the loading wheel as track is downloading |
| songs: | (array) collection of objects that hold the track information each object MUST have the properties “name” (name of the track to display) and “file” (path to actual mp3 file) |