提交 b497230d 编写于 作者: d-u-a's avatar d-u-a

fix: getBackgroundAudioManager 的 onPrev 和 onNext 无效的问题

上级 b863a8e1
......@@ -72,6 +72,8 @@ const props = [
default: 'http'
}
]
const backgroundEvents = ['prev', 'next']
class BackgroundAudioManager {
constructor () {
......@@ -89,6 +91,15 @@ class BackgroundAudioManager {
} : {})
}
})
})
backgroundEvents.forEach((name) => {
onMethod(`onBackgroundAudio${name[0].toUpperCase() + name.substr(1)}`, () => {
callbacks[name].forEach(callback => {
if (typeof callback === 'function') {
callback({})
}
})
})
})
props.forEach(item => {
const name = item.name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册