微信小程序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