在mac 谷歌浏览器下,提示错误play() failed because the user didn't interact with the document first.
componentDidMount() {
$("#player").jPlayer({
ready: function(){
$(this).jPlayer("setMedia", {
'mp3': '
http://oj4t8z2d5.bkt.clouddn.com/%E9%AD%94%E9%AC%BC%E4%B8%AD%E7%9A%84%E5%A4%A9%E4%BD%BF.mp3',
}).jPlayer('play');
},
supplied: "mp3",
vmode: "window",
size:{
width:"640px",
height:"396px",
cssClass:"jp-video-360p"
},
});
$('#player').bind($.jPlayer.event.timeupdate, e => {
this.setState({
progress: Math.round(e.jPlayer.status.currentTime)
})
})
}