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浏览器下无法使用,所以只好使用第一个方法进行替换这个方法

posted @ 2016-03-12 11:18  五毛钱的饼  阅读(966)  评论(0编辑  收藏  举报