微信小游戏:音频播放
作者:
cmd_ts | 来源:发表于
2018-09-18 18:00 被阅读37次//远程地址:
this.voice_back = wx.createInnerAudioContext();
var back_url = "http://ossall.5iape.com/upload/allmusic/beijing/yxjjs.mp3";
this.voice_back.src = back_url; // src 可以设置 http(s) 的路径,本地文件路径或者代码包文件路径
this.voice_back.loop = true;//循环播放,详细查看微信的API
this.voice_back.play();
//本地地址:
this.voice_fail.src = cc.url.raw('resources/sounds/fail.mp3',);
//暂停某A首歌,播放B首歌后,再播放A首歌
this.dq_view_js.voice_back.pause();
this.voice_ok.play();
this.voice_ok.onEnded(()=>{
this.dq_view_js.voice_back.play();
});
本文标题:微信小游戏:音频播放
本文链接:https://www.haomeiwen.com/subject/fuhmnftx.html
网友评论