how to detect end of audio file using jquery and html5

后端 未结 3 942
别跟我提以往
别跟我提以往 2021-01-02 21:19

I\'ve got this jquery code and html to work OK for an English language training site.

$(document).ready(function() {
  $(\"p\").hover(
    function() {
             


        
3条回答
  •  走了就别回头了
    2021-01-02 21:28

    var myAudio = new Audio('someSound.ogg'); 
    myAudio.addEventListener('ended', function() {
        this.currentTime = 0;
        this.play();
    }, false);
    myAudio.play();
    

    This Worked for jquery audio.

提交回复
热议问题