用wavesurfer绘制波形图加载网络资源波形不出现,加载本地相对路径的就一切正常
打印错误出现 Error: HTTP error status: 0
刚开始声音都播放不了,加入了backend:'MediaElement'这个配置声音可以正常出现,波形还是加载不了
### 相关代码
this.bottomWavesurfer=WaveSurfer.create({
barWidth:3,
container:'#audioPlay',
waveColor: "#464C55",
progressColor: "#FFA600",
cursorColor: "#fff",
backend:'MediaElement',
height: 40,
xhr:{
mode:"no-cors"
}
});
this.bottomWavesurfer.load(this.playData.master);
// this.bottomWavesurfer.load("./static/obj_wo3DlMOGwrbDjj7DisKw_4442982362_0e99_5b56_f906_136dfc1bcf0f129963c8df412f561626.mp3")
// this.bottomWavesurfer.load('http://replacebeat.com/static/aaa.mp3')
var that=this;
this.bottomWavesurfer.on('ready',()=>{
console.log('加载完成');
that.isplay=true;
that.bottomWavesurfer.play();
})
this.bottomWavesurfer.on('error',err=>{
console.warn(err);
})
this.bottomWavesurfer.on('finish',()=>{
that.isplay=false;
})
该怎么解决
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…