代码(略去部分):
$.Audio || ($.Audio = new Audio);
$.Audio.src = '...';
var id = '19283749';
$.Audio.play();
$.Audio.addEventListener("canplaythrough", function() {
var ct = $.Audio.currentTime,
dt = $.Audio.duration;
$(".process-" + id).html(ct / dt * 100 + '%;');
}, false);
}
这样只能执行一次,显示的进度是0%,怎样写才可以让他动态显示?
相关分类