提交 b7511492 编写于 作者: D DCloud_LXH

feat(app-plus): 音频api立即触发timeupdate事件

上级 f042fea6
......@@ -172,6 +172,7 @@ onMethod('onAudioStateChange', ({
emit(audio, state, errMsg, errCode)
if (state === 'play') {
const oldCurrentTime = audio.currentTime
emit(audio, 'timeupdate')
audio.__timing = setInterval(() => {
const currentTime = audio.currentTime
if (currentTime !== oldCurrentTime) {
......
......@@ -75,6 +75,7 @@ function initMusic () {
function startTimeUpdateTimer () {
stopTimeUpdateTimer()
publishBackgroundAudioStateChange('timeUpdate', {})
timeUpdateTimer = setInterval(() => {
publishBackgroundAudioStateChange('timeUpdate', {})
}, TIME_UPDATE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册