I am using Chrome and this is my code:
<audio id="letter_audio" src="audio/bomb.mp3" type="audio/mp3" preload="auto"></audio>
$('.sound').live('click', function () {
var sound = $("#letter_audio")[0];
sound.pause();
sound.currentTime = 0;
sound.play();
return false;
});
How come the sound plays the first time I click on play. then when I click again, it pauses, like the code goes. but the it justs stays on pause? i want it to play, then when i click on it again, go back to 0 and play again as in the code?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…