what if i copied a few files from reactaudioplayer to an amcharts slider?

You need to wrap your callbacks with arrow functions that call your methods directly (or call bind: this.sound.bind(this)) so that it resolves to the correct this scope:

<ReactAudioPlayer 
  src="{audio}" 
  onPlay={(ev) => this.sound(ev)} 
  onListen={(ev) => this.lis(ev)} 
  onSeeked={(ev) => this.seek(ev)} 
controls></ReactAudioPlayer>

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top