Coder Social home page Coder Social logo

jquery-soundmanager's Introduction

@see http://www.schillmania.com/projects/soundmanager2/doc/download/#latest for Sound Manager download
@see http://www.schillmania.com/projects/soundmanager2/doc/ for Sound Manager documentation

USAGE EXEMPLES:
/* Minimum settings */
// Always do settings before DOM is ready!
$.playable('soundmanager/swf/');
$(function(){
	// Simple usage for mp3 links
	$('a[href$=.mp3]').playable();
});
/* Options settings */
// Again, do settings before DOM is ready!
$.playable('soundmanager/swf/', { // You can set all SM2 default options & properties, plus the followings:
	autoStart : false, // Start playing the first item
	playNext : false, // Play next item when previous ends
	loopNext : false, // Play first item when no more next item
	pauseOnly : false, // Just pause previous on skip
	playAlone : false, // Force stop/pause previous on skip
	doUnload : false // Unload sound on stop/finish
});
/* You also can pass just one object containing the swf URL, for convinience:
$.playable({
	url: 'soundmanager/swf/',
	autoStart : false,
	...
});
*/
$(function(){
	//You can also overwrite default options for each DOM selection
	$('ul.playlist').playable({autoStart: true, playNext: true, playAlone: true, pauseOnly: false, doUnload: false});
	$('div.sampler').playable({autoStart: false, playNext: false, playAlone: false, pauseOnly: false, doUnload: false});
	$('a.listen').playable({autoStart: false, playNext: false, playAlone: true, pauseOnly: true, doUnload: true});

// TO Modify Sound Objects (you can use all SMSound methods)
	$('.playlist').playable('setVolume', 50); // reduce sound to 50% for the whole playlist
	$('.sampler .playable:eq(1)').playable('pause'); // pause the second playable item of the sampler
	$('.listen .playable:last').playable('play'); // play the last playable item of the '.listen' list
	...

// TO Play next song in current playlist
	$.playable.next(); // plays next song with the same selector as the current song playing
	$.playable.next(2); // plays the one after the next song with the same selector as the current song playing
	$.playable.next(-1); // plays previous song with the same selector as the current song playing
	...
});


FOR DEVELOPERS
* You can access sound object via $(element).data('playable')
* You can add your own event handlers with $(element).bind( type* , function( event, sound ){...}) [* SMSound events]
* You can add more SMSound events handlers in $.playable.events (like onid3, ondataerror, etc.. @see jquery.playable.ui.simple.js for a exemple how to extend the plugin/build an UI)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.