- 当前 Bug 的表现(可附上截图)
开发好的功能,在2019-01-08那天在真机上还能正常播放,今天不能在真机上正常播放了。但是目前在微信开发者工具中正常播放
- 预期表现
希望正常播放
- 复现路径
- 提供一个最简复现 Demo
playAudio() {
let audioCtx = wx.createInnerAudioContext();
let src = this.data.tempPath;
console.log(src);
audioCtx.src = src;
this.setData({
‘audioCtx’: audioCtx,
‘currentDuration’: ‘00:00’,
‘percentage’: 0
});
audioCtx.play();
audioCtx.onPlay(() => {
let totalTime = this.data.duration;
let count = 0;
this.setData({
‘play’: true
});
let audio = setInterval(() => {
if (count >= totalTime) {
audioCtx.pause();
clearInterval(audio);
this.setData({
‘play’: false,
‘percentage’: 100
});
} else {
let showDuration;
count++;
let min = parseInt(count / 60);
let senconds = Math.ceil(count % 60);
let newMin, newSenconds;
if (min < 10) {
newMin = ‘0’ + min;
} else {
newMin = min;
}
if (senconds < 10) {
newSenconds = ‘0’ + senconds;
} else {
newSenconds = senconds;
}
showDuration = newMin + ‘:’ + newSenconds;
this.setData({
‘currentDuration’: showDuration,
‘percentage’: (count / totalTime) * 100
});
}
}, 1000);
this.setData({
‘audioInterval’: audio
});
})
},