我需要获取音频的当前播放时间。 我一直在使用 react-wavesurfer播放音频的包,我可以看到 wavesurfer.js有一种获取当前播放时间的方法,但我似乎无法弄清楚如何用 React 来做到这一点。
最佳答案
他们的 DOCS 中似乎有 onPosChange
事件
Is basically called on audioprocess and seek events and consolidates the received time formats into the same type of argument object as the onAudioprocess callback (time in seconds, not as a relative value):
{ wavesurfer: wavesurferInstance, originalArgs:
[playBackPositionInSecs]
}
它似乎与“无 react ”audioprocess
相同event :
关于javascript - 如何在 react-wavesurfer 中获取当前播放时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46320902/