音频资源 load 之后通过微信桥接触发播放
soundBgm.on('load', () => {
window.WeixinJSBridge && window.WeixinJSBridge.invoke('getNetworkType', {}, () => {
soundBgm.play();
}, false);
function getMusic(el, showMusic = true) {
var className = 'play'
// var trigger = 'ontouchend' in document ? 'touchstart' : 'click'
var $musci = document.createElement('div')
$myaudio.
之前一直用微信的jssdk监听:也就是网上常用的代码
<audio style="; height: 0" id="mymusic" preload="auto" src="../static/videos/bg-music.mp3" loop="loop"></audio>
function audioAutoPlay(id){
var audio = document.getElementById(id);
audio.play()
【记录2】in ./node_modules/vuex/dist/vuex.esm-bundler.js export ‘inject‘ (imported as ‘inject‘) was not