react-audioplayer
react-audioplayer copied to clipboard
cant stop the player with react router
I am using react router and when I navigate back the audio keep playing I tried this in the stopPlaying() { ReactDOM.findDOMNode(this.state.autoplayref).dispatchEvent(new Event('pause')); } and then componentWillUnmount() { this.props.shuirimprops.stopPlaying(); }
but not working. I am doing the same thing for playing and pausing and it works fine I think the ref is alread gone by the time the async method excutes