onTimeUpdate()开发者在开发者工具中正常运行,在真机环境下么有执行
onTimeUpdate(){
console.log(‘hello’);
//需要更新的数据
const update = {
duration: audio.duration,
currentTime: audio.currentTime,
paused: audio.paused,
buffered: audio.buffered
}
//数据合并
Object.assign(this.data.song,update);
this.setData({
song:this.data.song
})
}
