var myVid1=document.getElementById("audio_1");
$(".div_audio_1 span").text(audioDeal(myVid1.duration.toString().split(".")[0]));

function audioDeal(time) {
var hour = "";
var min = "";
var sec = "";
if(Math.floor(parseInt(time)/3600) < 10) {
hour = "0" + Math.floor(parseInt(time)/3600);
} else {
hour = Math.floor(parseInt(time)/3600);
}

if(Math.floor(parseInt(time)%3600/60) < 10) {
min = "0" + Math.floor(parseInt(time)%3600/60);
} else {
min = Math.floor(parseInt(time)%3600/60);
}

if(parseInt(time)%3600%60 < 10) {
sec = "0" + parseInt(time)%3600%60;
} else {
sec = parseInt(time)%3600%60;
}
return hour + ":" + min + ":" + sec;
}

posted on 2016-03-09 09:14  vofill-work  阅读(630)  评论(0编辑  收藏  举报