2

谁能给我一个关于如何使用 wavesurfer.js 在波形中创建注释的提示?就像 SoundCloud 一样。太感谢了!

4

1 回答 1

-1

要获得与 00:00 相同的时间,您可以执行以下操作,例如:

function timeformat(timeget) {
    if (!timeget) {return "00:00";}

    var min = Math.floor(timeget / 60);
    var sec = Math.ceil(timeget) % 60;

    return (min < 10 ? '0' : '') + min + ":" + (sec < 10 ? '0' : '') + sec;
};
timeformat(wavesurfer.getCurrentTime());
于 2018-01-23T13:45:43.930 回答