justinmc / react-audio-player

A simple React wrapper on the HTML5 audio tag
MIT License
587 stars 103 forks source link

Add 'loadedmetadata' handler. #28

Closed andremalkine closed 7 years ago

andremalkine commented 7 years ago

Just a suggestion. It's possible to wait for 'canplay' or 'canplaythrough', but when making custom controls getting the duration of the targeted track as soon as possible is nice.

justinmc commented 7 years ago

@andremalkine Thanks for the suggestion. What do you think of something like onDurationChange that ties to the html element's durationchange event?

There are a few native audio tag features like this that I still want to create a nice wrapper for at some point. Let me know if that would handle your use case and I'll go ahead and write a PR.

egdbear commented 7 years ago

#37

justinmc commented 7 years ago

Closing with https://github.com/justinmc/react-audio-player/pull/37