Html5 audio can't play again after it stopped -


i declare audio file in page:

var audio = new audio('my.mp3'); 

then use click event play it:

$(document).click(function () {     audio.currenttime = 0; // make sure play begain     audio.play();     }) 

it can play @ first click time, after ended, click document, can not play again.how can let play again?

i tested in chrome , exception occurs due audio.currenttime statement.

this worked (also in ie9):

$(document).click(function () {     audio.src = "my.mp3";     audio.play();  }) 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -