uni.getBackgroundAudioManager() 设置了新的src 后没有播放 音频都是MP3格式 有解决!!!!!!
that.innerAudioContext = uni.getBackgroundAudioManager();
that.innerAudioContext.title = '提示音频';
that.innerAudioContext.singer = '暂无';
that.innerAudioContext.src = that.audio[0]; //音频地址
that.innerAudioContext.onPlay(function(res) {
console.log('开始播放音频111');
});
that.innerAudioContext.onEnded(function(res) {
console.log('播放音频完成');
if(!that.isPay){
console.log('在次播放');
// 这里就没有播放了 !!!!!!!!!!
that.innerAudioContext.onStop();
that.isPay = true;
that.innerAudioContext.src = that.audio[1];//音频地址
that.innerAudioContext.play() // 修改后要播放 !!!!!!!!!!
}else{
that.innerAudioContext.onStop(function(res){
console.log('停止播放');
});
}
});
2 个回复
9***@qq.com (作者)
有人知道吗? 又不能销毁重新 创建 ,赋值有不能播放。哎!
9***@qq.com (作者)
play()