Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to know when an audio is completed? #121

Open
Illakkiya03 opened this issue Jul 26, 2021 · 1 comment
Open

How to know when an audio is completed? #121

Illakkiya03 opened this issue Jul 26, 2021 · 1 comment

Comments

@Illakkiya03
Copy link

I tried using onEnd() and onStop() methods, but there was no alert during the end of the audio, instead I got an alert at the beginning of the audio. Thanks in advance!

@Stenerson
Copy link
Collaborator

Hi @Illakkiya03,

I'm not seeing this behavior. It's working as expected when I add the following to the FullControl example:

onStop logs message when I press the "Stop" button

<ReactHowler
  // ...
  onStop={() => console.log('onStop')}
  // ...

onEnd logs message when the sound playback is complete

  handleOnEnd () {
    console.log('handleOnEnd');
    this.setState({
      playing: false
    })
    this.clearRAF()
  }

Could you provide more details or a code example?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants