微信小程序innerAudioContext接口


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

欢迎关注,有问题一起学习欢迎留言、评论。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM