Reputation: 38
I'm trying to add audio playing and set duration. But Can't see the time, min and second control bar. Can someone help with this?
$("#audio").on("canplaythrough", function(e){
var seconds = e.currentTarget.duration;
var duration = moment.duration(seconds, "seconds");
var time = "";
var hours = duration.hours();
if (hours > 0) { time = hours + ":" ; }
time = time + duration.minutes() + ":" + duration.seconds();
URL.revokeObjectURL(objectUrl);
});
Upvotes: 1
Views: 40
Reputation: 121
I think you just add the time value to any element. for example
$("#id).text(time);
Please let me know if it helps.
Upvotes: 1