Html5 audio stop

1 //html5 stop audio play
2 function stopPlay(el){
3   el.pause();
4   el.currentTime = 0;
5 }

使用:

var el = document.getElementById("eva2_m3");

stopPlay(el);

参考了:HTML5 Audio stop function

1 HTMLAudioElement.prototype.stop = function()
2 {
3     this.pause();
4     this.currentTime = 0.0;
5 }

这个方法虽然差不多的效果,但是在chromium浏览器下无法使用,所以只好使用第一个方法进行替换这个方法

原文地址:https://www.cnblogs.com/fsong/p/5268194.html