音频iso获取时长duration为0?
发布于 7 年前 作者 xiulan93 10936 次浏览 来自 官方Issues
myaudio.src = "https://hmj-api.tapfun.cc/file/downloadFileMedia/d1928912-9b0d-4b6c-9328-ae7183246c12.mp3";
that.duration=that.formatSeconds(res.data.audioDuration);
myaudio.onTimeUpdate(function(){
  setTimeout(() => {
    let durationnum = parseInt(myaudio.duration);
    let time = that.formatSeconds(myaudio.duration);
    that.duration = time;
    that.durationNum = durationnum;
  });
  that.changeCurrent(myaudio.currentTime)
})
1 回复

先写个myaudio.onPlay(function callback),再用myaudio.onTimeUpdate(function callback)

回到顶部