Closed matteomontipo closed 1 year ago
onPlay
listens to exactly the play event which means the event fires when playback has begun, not when clicking the play button. Using onPlayError
to capture empty src
is fine. Is there any other use cases that cannot be covered by these two events?
Hi, so I just found out that if the src is empty, the function i'm calling within the onPlay parameter doesn't fire at all, found out that's because it goes into the onPlayError and stops there.
My case: I play the audio with some custom logic throughout a function, which is called within onPlay as onPlay={() => handlePlay()} and I'd like to decide what happens if the user clicks it when the app just loaded and no mp3 src has been set yet.
It'd be nice to have more control of what happens when the Play button is clicked.