this.audio = uni.getBackgroundAudioManager();
this.audio.src = ''
this.audio.onPlay(() => {
console.log('开始播放');
this.rotate()
});
this.audio.onStop(() => {
console.log('停止播放');
});
this.audio.onPause(() => {
console.log('暂停播放');
clearInterval(InterVal)
});
this.audio.onEnded(() => {
//初始化 需要的参数
console.log('自然播放结束事件');
if(this.isCurrent && this.isCurrent == 1){
console.log('进去定时')
clearInterval(this.timeSet)
this.isPlay = false;
this.isCurrent = 0
this.timedPause = true
}else {
console.log('下一首')
this.jump(2)
}
});
this.audio.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
});
3 个回复
p***@qq.com
真机遇到这个问题,请问解决了么?
传播星球
请问怎么解决的
clai
再次进入时,做个判断,audio是不是已经有了