voice:function(){
var word = this.data.word;
var src = 'https://……/'+word['word']+'.mp3';
console.log(src);
this.innerAudioContext.autoplay = true;
this.innerAudioContext.obeyMuteSwitch = true;
this.innerAudioContext.src = src;
// this.innerAudioContext.onPlay(() => {
// console.log('开始播放')
// });
this.innerAudioContext.play();
this.innerAudioContext.onError((e) => {
console.log(e.errMsg)
console.log(e.errCode)
})
},
文章来源:刘俊涛的博客
地址:http://www.cnblogs.com/lovebing
欢迎关注,有问题一起学习欢迎留言、评论。