audioDom.oncanplaythrough = function(){
var msecond = this.duration;//获得整个音乐的长度 var m = parseInt(msecond/60);//分 var s = parseInt(msecond%60);//秒 var ms = (m<10 ? ("0"+m):m)+":"+(s<10 ? ("0"+s):s); document.getElementById("time").innerHTML = ms; };本文共 302 字,大约阅读时间需要 1 分钟。
audioDom.oncanplaythrough = function(){
var msecond = this.duration;//获得整个音乐的长度 var m = parseInt(msecond/60);//分 var s = parseInt(msecond%60);//秒 var ms = (m<10 ? ("0"+m):m)+":"+(s<10 ? ("0"+s):s); document.getElementById("time").innerHTML = ms; };转载于:https://www.cnblogs.com/xiaoyunyun/p/4823681.html