View Single Post
Old 05-10-2012, 09:16 PM   PM User | #2
jerrell
New Coder

 
Join Date: Nov 2011
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
jerrell is an unknown quantity at this point
Solution to the problem

I was able to put together a solution for the problem I was having... still a few bugs but in case anyone else runs into this problem. Here is the working code (with minor bugs).


Code:
$( function() {
    var $volume = $( '#volume' );
    var $start = $('#startbutton');
       
    buzz.defaults.formats = [ 'ogg', 'mp3' ];

    var Sound = new buzz.sound( 'audio/birthday' );
        
$start.click(function(){
    if ( !buzz.isSupported() ) {
                   
    }else{
    
    Sound.play().fadeIn( 5000 );
	}
    });
    // Volume button

    $volume.click( function() {
        if ( $( this ).hasClass( 'all' ) ) {
             Sound.mute();
         
            $( this ).removeClass( 'all' ).addClass( 'none' );
        } else if ( $( this ).hasClass( 'none' ) ) {
           
            Sound.unmute();
        
            $( this ).removeClass( 'none' ).addClass( 'all' );
        }
        return false;
    });

});
jerrell is offline   Reply With Quote