I am looking for a way to play a different sound on each player and have the ability to pause play and have two players not play at the same time. I would like to play as many as I want if possible. My js currently only works for one player.
All the code on js fiddle: http://jsfiddle.net/st2b9rfn/1/
Only js :
var audio = new Audio("https://assets.mixkit.co/sfx/download/mixkit-retro-game-notification-212.wav");
$('#ppb1').on("click",function(){
if($(this).hasClass('fa-play'))
{
$(this).removeClass('fa-play');
$(this).addClass('fa-pause');
audio.play();
}
else
{
$(this).removeClass('fa-pause');
$(this).addClass('fa-play');
audio.pause();
}
});
audio.onended = function() {
$("#ppb1").removeClass('fa-pause');
$("#ppb1").addClass('fa-play');
};