苹果手机无法播放音频,点击音频没有反应。?The iPhone cannot play audio, and there is no response to clicking on the audio. ?
苹果手机列表音频无法播放问题,在网上做了代码设置还是不生效,点击播放音乐按钮触发
const innerAudioContext = wx.createInnerAudioContext() //播放录音
console.log(e.target.dataset.id+"==========播放音频路径====="+JSON.stringify(e))
if (wx.setInnerAudioOption) {
wx.setInnerAudioOption({
obeyMuteSwitch: false,
autoplay: true
})
}else {
innerAudioContext.obeyMuteSwitch = false;
innerAudioContext.autoplay = true;
}
innerAudioContext.autoplay = true //是否自动播放
innerAudioContext.src = "https://wish.a2a.xin"+e.target.dataset.id, //音频资源的地址,用于直接播放
innerAudioContext.onPlay(() => {
console.log('开始播放')
})
//监听各个阶段
innerAudioContext.onCanplay(() => {
console.log('可以播放');
});
innerAudioContext.onPlay(() => {
console.log('监听到音频开始播放');
});
innerAudioContext.onEnded(() => {
console.log('音频自然播放结束事件');
});
innerAudioContext.onStop(() => {
console.log('音频停止事件');
});
innerAudioContext.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
});
innerAudioContext.onWaiting((res) => {
console.log('音频加载中事件,当音频因为数据不足,需要停下来加载时会触发')
});
苹果手机的播放音频三角形还是不会有任何反应
Apple's list audio can't be played. After setting the code on the Internet, it still doesn't work. Click the play music button to trigger const inneraudiocontext= wx.createInnerAudioContext () / / play the recording console.log (e. target.dataset.id +"= = = = = play audio path = = ="+ JSON.stringify (e)) if ( wx.setInnerAudioOption ) { wx.setInnerAudioOption ({ obeyMuteSwitch: false, autoplay: true }) }else { innerAudioContext.obeyMuteSwitch = false; innerAudioContext.autoplay = true; } innerAudioContext.autoplay =True / / auto play innerAudioContext.src = " https://wish.a2a.xin "+e. target.dataset.id , //The address of the audio resource for direct playback innerAudioContext.onPlay (() => { console.log ('Start playing ')}) / / monitor each stage innerAudioContext.onCanplay (() => { console.log ('can play ');}; innerAudioContext.onPlay (() => { console.log ('listen to audio and start playing ');}); innerAudioContext.onEnded (() => { console.log ('audio natural play end event ');}); innerAudioContext.onStop (() => { console.log ('audio stop event ');}); innerAudioContext.onError ((res) => { console.log ( res.errMsg ); console.log ( res.errCode ); }); innerAudioContext.onWaiting ((res) => { console.log ('audio loading event, which will be triggered when the audio needs to stop to load due to insufficient data ')}); the playback audio triangle of Apple phone still has no response
换一个视频格式看看呢