Get your own customer support community

Recent activity

Subscribe to this feed
  • idea

    adrien Gibrat replied on November 22, 2009 19:00 to the idea "Using SoundManager 2 as Jquery plugin" in Schillmania!:

    adrien Gibrat
    And the ui file implements a basic player (no equalizer, nor balance) as in page player....
  • question
  • idea
  • idea

    adrien shared an idea in Schillmania! on January 28, 2009 11:07:

    adrien
    Using SoundManager 2 as Jquery plugin
    I wrote a simple plugin actig like inlineplayer.js, but with jQuery (Feel free to use/modify!):

    $.playable = function( url, settings ) {
    var sm = soundManager,
    playable = arguments.callee;
    sm.url = url;
    sm.consoleOnly = window.location.hash.match(/console$/i);
    sm.debugMode = window.location.hash.match(/^#debug/i);
    $.extend( sm.defaultOptions,
    {
    autoStart : false,
    autoNext : true,
    pauseSkip : true,
    playAlone : true,
    doUnload : false,
    css : {
    playable: 'playable',
    playing : 'playing',
    paused : 'paused'
    },
    onload : function() {
    if ( this.readyState == 2 )
    playable.next.call( this );
    },
    onplay : function() {
    var options = this.options,
    current = options.element.removeClass( options.css.paused ).addClass( options.css.playing ).focus();
    if ( playable.current && playable.current != current )
    playable.current.data( 'playable' )[ options.pauseSkip ? 'pause' : 'stop' ]();
    if ( options.playAlone )
    playable.current = current;
    },
    onstop : function() {
    var options = this.options;
    options.element.removeClass( options.css.playing + ' ' + options.css.paused );
    if ( options.doUnload )
    this.unload();
    },
    onpause : function() {
    var options = this.options;
    options.element.removeClass( options.css.playing ).addClass( options.css.paused );
    },
    onresume : function() {
    this.options.onplay.call( this );
    },
    onfinish : function() {
    var options = this.options;
    if ( options.autoNext )
    playable.next.call( this );
    options.onstop.call( this );
    }
    },
    settings
    );
    $.extend( playable, {
    count : 0,
    current : null,
    init : function( options ) {
    var self = this,
    options = $.extend( true, {}, sm.defaultOptions, options );
    this.addClass( options.css.playable )
    .click( function( event ) {
    event.preventDefault();
    $( this ).data( 'playable' ).togglePause();
    } )
    .each( function() {
    $( this ).data( 'playable', sm.createSound( $.extend(
    {
    id : 'playable' + playable.count++,
    url : this.href,
    element : $( this ),
    selector: self.selector
    },
    options
    ) ) );
    } );
    if ( options.autoStart )
    self.filter( ':first' ).click();
    },
    next : function() {
    var options = this.options,
    next = $( options.element ).next( options.selector ).data( 'playable' );
    if ( next && ! next.playState )
    next.play();
    }
    }
    );
    };
    $.fn.playable = function( options ) {
    var self = this.is( 'a[href]' ) ? this : this.find( 'a[href]' );
    soundManager.onload = function() {
    if ( soundManager.canPlayURL( self.attr( 'href' ) ) )
    $.playable.init.call( self, options );
    };
    };

    $(function(){
    /* Simple usage */
    $.playable('soundmanager/swf/');
    $('a').playable();
    /* Full usage, with options
    $.playable('soundmanager/swf/', { //options used here are stored as soundManager.defaultOptions
    // You can use all SM2 default options, plus the following:
    autoStart : false, // Start playing the first item
    autoNext : false, // Play next itemwhen previous ends
    pauseSkip : false, // Just pause previous on skip
    playAlone : false, // Force stop/pause previous on skip
    doUnload : false // Unload sound on stop/finish
    });
    //Exemples configurations
    $('.playlist').playable({autoStart: true, autoNext: true, playAlone: true, doUnload: false});
    $('.sampler').playable({autoStart: false, autoNext: false, playAlone: true});
    $('.listen').playable({autoStart: false, autoNext: false, playAlone: true,pauseSkip: true, doUnload: true});
    */
    });
  • question

    adrien asked a question in Mozilla on October 24, 2008 00:28:

    adrien
    call ubiquity command from bookmarklet / javascript
    It could be usefull... i'm bored to write 'translate this in french'... and other frequent command i use, it could be great to be able to create buttons that trigger an ubiquity command!