Last active
December 27, 2015 18:29
-
-
Save marcosfreitas/24564c626d2e1ddce44c to your computer and use it in GitHub Desktop.
Source of jQuery mini player using HTML 5.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Player | |
$('audio').get(0).controls = false; | |
/*$('#player').click(function(){ | |
p = $(this); | |
if(p.hasClass('mutted')){ | |
p.removeClass('mutted'); | |
$('audio').get(0).currentTime=0; | |
$('audio').get(0).play(); | |
}else{ | |
p.addClass('mutted'); | |
$('audio').get(0).pause(); | |
} | |
});*/ | |
$('#player').hover(function(){ | |
p = $(this); | |
if(p.hasClass('mutted')){ | |
p.removeClass('mutted'); | |
$('audio').get(0).currentTime=0; | |
$('audio').get(0).play(); | |
}/*else{ | |
p.addClass('mutted'); | |
$('audio').get(0).pause(); | |
}*/ | |
}, | |
function(){ | |
p = $(this); | |
if(!p.hasClass('mutted')) | |
p.addClass('mutted'); | |
$('audio').get(0).pause(); | |
}); | |
$(window).load(function(){ | |
//console.log('loaded'); | |
//change the icon when the jingle has ended | |
document.getElementById('onsplayer').addEventListener('ended', function(){ | |
p = $('#player') | |
if(p.hasClass('mutted')){ | |
p.removeClass('mutted'); | |
}else{ | |
p.addClass('mutted'); | |
} | |
},false); | |
}); | |
// Fim do Player |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment