I am using react-music-player(lijinke666/react-music-player) for my audio application . I works fine but i have a use case where i have to control play and pause of the audio from a button outside the player . Player's play and pause button works fine but according to m use case it should controlled from outside play/pause button as well.
Here is the implementation done till now :
this.state = {
playing: false,
options: {
audioLists: [
{
singer: "Jay Chou",
cover: this.props.thumbnail,
musicSrc: this.props.streamUrl,
},
],
autoPlay: true,
mode: "full",
clearPriorAudioLists: true,
},
defaultPosition: {
bottom: 0,
},
};
<ReactJkMusicPlayer {...options} />
Any suggestions on how to trigger play/puse function from outside the player ?