lhz516 / react-h5-audio-player

React audio player component with UI. It provides time indicator on both desktop and mobile devices.
https://codepen.io/lhz516/pen/dyGpmgP
MIT License
608 stars 92 forks source link

Is it possible to start the audio clip at a certain time? #155

Closed bturner1273 closed 2 years ago

bturner1273 commented 2 years ago

It would be useful for my application to be able to start an audio clip somewhere not at the beginning of the clip and/or jump to a specific point in time in the audio. Is this possible?

i.e. like a setProgress hook?

lhz516 commented 2 years ago

Get the audio ref and set currentTime after it renders.

Eg. this.player.current.audio.current.currentTime = 120. See the advanced usage section in the doc.

sgarchavada commented 1 year ago

@lhz516 where is the doc? can you share a link here? I am trying to find advanced usage. but I dont know where to look.