stopping html5 audio

前端 未结 3 1261
借酒劲吻你
借酒劲吻你 2021-01-21 23:41

How would I write a function that stops ALL instances of playing html5 audio in the DOM?

html5 audio

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-22 00:12

    This worked for me. .stop() threw an error.

    $.each($('audio'), function () {
        this.pause();
    });
    

提交回复
热议问题