You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to control play and pause with custom buttons doesn't work .Issue is the audio gets paused/played if i do this.audio.pause()/this.audio.play() . But the play/pause button doesn't sync with audio play/pause.
The player does not support this feature. I would consider adding the feature for custom button.
In fact, if custom button is fully supported, it can cause more problems.
The reason for adding getAuioInstance this is because like change playbackRate attr, nothing to do with the player native ui, so I support pause and play from custom button later
Trying to control play and pause with custom buttons doesn't work .Issue is the audio gets paused/played if i do this.audio.pause()/this.audio.play() . But the play/pause button doesn't sync with audio play/pause.
this.state = {
audio:null,
options: {
audioLists: [
{
singer: "Jay Chou",
cover: this.props.thumbnail,
musicSrc: this.props.streamUrl,
},
],
autoPlay: true,
mode: "full",
clearPriorAudioLists: true,
},
defaultPosition: {
bottom: 0,
},
};
togglePlay =()=>{
this.state.audio.pause()
}
<ReactJkMusicPlayer {...options} getAuioInstance={(instance=>this.setState({audio:instance})}/>
<button onClick={()=>this.togglePlay}>play
The text was updated successfully, but these errors were encountered: